Skip to content

Commit

Permalink
test(igx-grid): Move localization test in a separate describe, #2517
Browse files Browse the repository at this point in the history
  • Loading branch information
sstoyanovIG committed Nov 19, 2018
1 parent 7870b16 commit 385ecb5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1510,10 +1510,8 @@ describe('IgxGrid - Filtering Row UI actions', () => {
declarations: [
IgxGridFilteringComponent,
IgxGridFilteringScrollComponent,
IgxGridFilteringMCHComponent,
IgxGridFilteringLocalizedComponent
IgxGridFilteringMCHComponent
],
providers: [ { provide: LOCALE_ID, useValue: 'de' } ],
imports: [
BrowserAnimationsModule,
IgxGridModule.forRoot()]
Expand Down Expand Up @@ -2473,6 +2471,26 @@ describe('IgxGrid - Filtering Row UI actions', () => {

expect(filteringRow).toBeNull();
}));
});

describe('IgxGrid - Filtering translation', () => {
configureTestSuite();
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
IgxGridFilteringLocalizedComponent
],
providers: [ { provide: LOCALE_ID, useValue: 'de' } ],
imports: [
BrowserAnimationsModule,
IgxGridModule.forRoot()]
})
.compileComponents();
}));

afterEach(() => {
UIInteractions.clearOverlay();
});

it('Should translate Close button of FilterRow to German.', fakeAsync(() => {
const fix = TestBed.createComponent(IgxGridFilteringLocalizedComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ export class IgxLocalizationService {
}

rs = ResourceStrings[key];
if (rs && this.locale.startsWith('jp')) {
return rs.jp;
} else if (rs && this.locale.startsWith('ko')) {
return rs.ko;
if (rs) {
if (this.locale.startsWith('jp')) {
return rs.jp;
} else if (this.locale.startsWith('ko')) {
return rs.ko;
} else {
return rs.en;
}
} else {
return rs.en;
return key;
}
}

Expand Down

0 comments on commit 385ecb5

Please sign in to comment.