From 2e0a6936aa89212e7b18add249ac9343765203b7 Mon Sep 17 00:00:00 2001 From: Maurizio Vitale Date: Wed, 11 Oct 2017 10:10:25 +0100 Subject: [PATCH] ADF InfoDrawer the title and tabs label must be localized (#2454) --- .../components/task-details.component.html | 7 ++- .../ng2-activiti-tasklist/src/i18n/en.json | 3 ++ .../ng2-activiti-tasklist/src/i18n/it.json | 3 ++ .../info-drawer/info-drawer.component.html | 2 +- .../info-drawer/info-drawer.component.spec.ts | 52 ++++++++++++++++++- 5 files changed, 61 insertions(+), 6 deletions(-) diff --git a/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.html b/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.html index b814ee91b5..775d4c13b1 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.html +++ b/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.html @@ -51,13 +51,12 @@
- - +
clear
- +
- + -
Activities
+
{{title}}
diff --git a/ng2-components/ng2-alfresco-core/src/components/info-drawer/info-drawer.component.spec.ts b/ng2-components/ng2-alfresco-core/src/components/info-drawer/info-drawer.component.spec.ts index 9d7f676180..60230f1d1b 100644 --- a/ng2-components/ng2-alfresco-core/src/components/info-drawer/info-drawer.component.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/components/info-drawer/info-drawer.component.spec.ts @@ -15,8 +15,9 @@ * limitations under the License. */ -import { DebugElement } from '@angular/core'; +import { Component, DebugElement } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; import { MaterialModule } from '../../material.module'; import { InfoDrawerLayoutComponent } from './info-drawer-layout.component'; import { InfoDrawerComponent } from './info-drawer.component'; @@ -70,4 +71,53 @@ describe('InfoDrawerComponent', () => { expect(tabEmitSpy).toHaveBeenCalled(); expect(tabEmitSpy).toHaveBeenCalledWith('DETAILS'); }); + + it('should render the title', () => { + component.title = 'FakeTitle'; + fixture.detectChanges(); + let title: any = fixture.debugElement.queryAll(By.css('[info-drawer-title]')); + expect(title.length).toBe(1); + expect(title[0].nativeElement.innerText).toBe('FakeTitle'); + }); +}); + +@Component({ + template: ` + +
Fake Title Custom
+
+ ` +}) +class CustomInfoDrawerComponent { +} + +describe('Custom InfoDrawer', () => { + let fixture: ComponentFixture; + let component: CustomInfoDrawerComponent; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + InfoDrawerComponent, + InfoDrawerLayoutComponent, + CustomInfoDrawerComponent + ], + imports: [ + MaterialModule + ] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomInfoDrawerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should render the title', () => { + fixture.detectChanges(); + let title: any = fixture.debugElement.queryAll(By.css('[info-drawer-title]')); + expect(title.length).toBe(1); + expect(title[0].nativeElement.innerText).toBe('Fake Title Custom'); + }); });