Skip to content

Commit a59e487

Browse files
authored
Merge pull request #17124 from IgniteUI/sstoychev/fix-bad-date-test-20.1
test(filtering): fixing prevMonth calc in test
2 parents 8b730b0 + 3147f2f commit a59e487

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5141,7 +5141,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
51415141
// Verify the calendar is scrolled to previous month.
51425142
const headerLabel = document.querySelector('igx-calendar').querySelector('.igx-calendar-picker__date') as HTMLElement;
51435143
const today = new Date();
5144-
const prevMonth = new Date(today.setMonth(today.getMonth() - 1));
5144+
const prevMonth = new Date(today.getFullYear(), today.getMonth() - 1, 1);
51455145
const monthName = prevMonth.toLocaleString('default', { month: 'short' });
51465146
expect(headerLabel.innerText.trim()).toMatch(`${monthName}`);
51475147
}));

0 commit comments

Comments
 (0)