Skip to content

Commit 88ba714

Browse files
authored
Merge pull request #17126 from IgniteUI/sstoychev/fix-bad-date-test-m
test(filtering): fixing prevMonth calc in test
2 parents fbea76b + 0715655 commit 88ba714

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

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

0 commit comments

Comments
 (0)