Skip to content

Commit f7d2440

Browse files
committed
fix(tests): Make sure tests pass in >0 time zones too
1 parent 057d622 commit f7d2440

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid.component.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { AsyncPipe } from '@angular/common';
2727
import { IgxPaginatorComponent, IgxPaginatorContentDirective } from '../../paginator/paginator.component';
2828
import { IGridRowEventArgs, IgxColumnGroupComponent, IgxGridFooterComponent, IgxGridRow, IgxGroupByRow, IgxSummaryRow } from '../public_api';
2929
import { getComponentSize } from '../../core/utils';
30-
import { setElementSize } from '../../test-utils/helper-utils.spec';
30+
import { setElementSize, ymd } from '../../test-utils/helper-utils.spec';
3131

3232

3333
describe('IgxGrid Component Tests #grid', () => {
@@ -1717,11 +1717,11 @@ describe('IgxGrid Component Tests #grid', () => {
17171717
fixture.detectChanges();
17181718

17191719
rows = grid.rowList.toArray();
1720-
expectedValue = '21. März 2005';
1720+
expectedValue = `${ymd('2005-03-21').getUTCDate()}. März 2005`;
17211721
expect((rows[0].cells.toArray()[4] as any).element.nativeElement.textContent).toBe(expectedValue);
1722-
expectedValue = '15. Januar 2008';
1722+
expectedValue = `${ymd('2005-01-15').getUTCDate()}. Januar 2008`;
17231723
expect((rows[1].cells.toArray()[4] as any).element.nativeElement.textContent).toBe(expectedValue);
1724-
expectedValue = '20. November 2010';
1724+
expectedValue =`${ymd('2005-11-20').getUTCDate()}. November 2010`;
17251725
expect((rows[2].cells.toArray()[4] as any).element.nativeElement.textContent).toBe(expectedValue);
17261726

17271727
// verify summaries formatting
@@ -1735,7 +1735,7 @@ describe('IgxGrid Component Tests #grid', () => {
17351735
}
17361736
if (earliest) {
17371737
earliestValue = earliest.nativeElement.nextSibling.innerText;
1738-
expect(earliestValue).toBe('17. Mai 1990');
1738+
expect(earliestValue).toBe(`${ymd('1990-05-17').getUTCDate()}. Mai 1990`);
17391739
}
17401740
});
17411741
}));

0 commit comments

Comments
 (0)