Skip to content

Commit 1722733

Browse files
committed
test(*): Fix failing tests and try to fix some sporadic ones.
1 parent c3d9180 commit 1722733

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

projects/igniteui-angular/src/lib/calendar/calendar.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ describe("IgxCalendar - ", () => {
619619

620620
calendarRowsMar.forEach((row, idx) => {
621621
const firstRowItem = row.nativeElement.children[0];
622-
if (idx === 5) {
622+
if (idx === 4) {
623623
expect(firstRowItem.firstChild.innerText).toEqual(
624624
"12",
625625
);

projects/igniteui-angular/src/lib/core/utils.spec.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -291,24 +291,28 @@ describe('Utils', () => {
291291

292292
describe('date formatting', () => {
293293
it('should format string to dateTime', () => {
294-
expect(formatDate('2025-01-25T14:15:00', 'short', 'en-US')).toEqual('1/25/25, 2:15 PM');
295-
expect(formatDate('2025-01-25T14:15:00', 'medium', 'en-US')).toEqual('Jan 25, 2025, 2:15:00 PM');
296-
expect(formatDate('2025-01-25T14:15:00', 'long', 'en-US')).toEqual('January 25, 2025 at 2:15:00 PM GMT+2');
297-
expect(formatDate('2025-01-25T14:15:00', 'full', 'en-US')).toEqual('Saturday, January 25, 2025 at 2:15:00 PM Eastern European Standard Time');
294+
expect(formatDate('2025-01-25T14:15:00', 'short', 'en-US', "Europe/Sofia")).toEqual('1/25/25, 2:15 PM');
295+
expect(formatDate('2025-01-25T14:15:00', 'medium', 'en-US', "Europe/Sofia")).toEqual('Jan 25, 2025, 2:15:00 PM');
296+
expect(formatDate('2025-01-25T14:15:00', 'long', 'en-US', "Europe/Sofia")
297+
.includes('January 25, 2025 at 2:15:00 PM GMT+')).toBeTruthy();
298+
expect(formatDate('2025-01-25T14:15:00', 'full', 'en-US', "Europe/Sofia")
299+
.includes('January 25, 2025 at 2:15:00 PM GMT+')).toBeTruthy();
298300
});
299301

300302
it('should format string to date', () => {
301-
expect(formatDate('2025-01-25T14:15:00', 'shortDate', 'en-US')).toEqual('1/25/25');
302-
expect(formatDate('2025-01-25T14:15:00', 'mediumDate', 'en-US')).toEqual('Jan 25, 2025');
303-
expect(formatDate('2025-01-25T14:15:00', 'longDate', 'en-US')).toEqual('January 25, 2025');
304-
expect(formatDate('2025-01-25T14:15:00', 'fullDate', 'en-US')).toEqual('Saturday, January 25, 2025');
303+
expect(formatDate('2025-01-25T14:15:00', 'shortDate', 'en-US', "Europe/Sofia")).toEqual('1/25/25');
304+
expect(formatDate('2025-01-25T14:15:00', 'mediumDate', 'en-US', "Europe/Sofia")).toEqual('Jan 25, 2025');
305+
expect(formatDate('2025-01-25T14:15:00', 'longDate', 'en-US', "Europe/Sofia")).toEqual('January 25, 2025');
306+
expect(formatDate('2025-01-25T14:15:00', 'fullDate', 'en-US', "Europe/Sofia")).toEqual('Saturday, January 25, 2025');
305307
});
306308

307309
it('should format string to time', () => {
308-
expect(formatDate('2025-01-25T14:15:00', 'shortTime', 'en-US')).toEqual('2:15 PM');
309-
expect(formatDate('2025-01-25T14:15:00', 'mediumTime', 'en-US')).toEqual('2:15:00 PM');
310-
expect(formatDate('2025-01-25T14:15:00', 'longTime', 'en-US')).toEqual('2:15:00 PM GMT+2');
311-
expect(formatDate('2025-01-25T14:15:00', 'fullTime', 'en-US')).toEqual('2:15:00 PM Eastern European Standard Time');
310+
expect(formatDate('2025-01-25T14:15:00', 'shortTime', 'en-US', "Europe/Sofia")).toEqual('2:15 PM');
311+
expect(formatDate('2025-01-25T14:15:00', 'mediumTime', 'en-US', "Europe/Sofia")).toEqual('2:15:00 PM');
312+
expect(formatDate('2025-01-25T14:15:00', 'longTime', 'en-US', "Europe/Sofia")
313+
.includes('2:15:00 PM GMT+')).toBeTruthy();
314+
expect(formatDate('2025-01-25T14:15:00', 'fullTime', 'en-US', "Europe/Sofia")
315+
.includes('2:15:00 PM GMT+')).toBeTruthy();
312316
});
313317

314318
it('should format string to custom format', () => {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,6 @@ describe('IgxGrid - Column Moving #grid', () => {
811811
}));
812812

813813
it('Should be able to scroll/reorder columns that are out of view - with pinned columns.', (async () => {
814-
815814
grid.getColumnByName('ID').pinned = true;
816815
fixture.detectChanges();
817816

@@ -828,7 +827,7 @@ describe('IgxGrid - Column Moving #grid', () => {
828827
UIInteractions.simulatePointerEvent('pointermove', header, 456, 56);
829828
await wait(50);
830829
UIInteractions.simulatePointerEvent('pointermove', header, 110, 30);
831-
await wait(1000);
830+
await wait(2000);
832831
fixture.detectChanges();
833832

834833
// step 4 - verify the column being moved can be reordered among new columns

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import { GridSelectionMode, FilterMode, Size } from '../common/enums';
4949
import { ControlsFunction } from '../../test-utils/controls-functions.spec';
5050
import { FilteringStrategy, FormattedValuesFilteringStrategy } from '../../data-operations/filtering-strategy';
5151
import { IgxInputGroupComponent } from '../../input-group/public_api';
52-
import { formatDate, getComponentSize } from '../../core/utils';
52+
import { getComponentSize } from '../../core/utils';
5353
import { IgxCalendarComponent } from '../../calendar/calendar.component';
5454
import { GridResourceStringsEN } from '../../core/i18n/grid-resources';
5555
import { setElementSize } from '../../test-utils/helper-utils.spec';
@@ -1206,7 +1206,7 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
12061206

12071207
it('Should correctly change resource strings for filter row using Changei18n.', fakeAsync(() => {
12081208
fix = TestBed.createComponent(IgxGridFilteringComponent);
1209-
const strings = GridResourceStringsEN;
1209+
const strings = Object.assign({}, GridResourceStringsEN);
12101210
strings.igx_grid_filter = 'My filter';
12111211
strings.igx_grid_filter_row_close = 'My close';
12121212
changei18n(strings);

0 commit comments

Comments
 (0)