Skip to content

Commit

Permalink
test: fix datepicker test for Januart
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan Bansal committed Jan 9, 2025
1 parent 01be368 commit 5371d0d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion aform/tests/datepicker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ describe('datepicker component', () => {

const $prevMonthBtn = wrapper.find('#previous-month-btn')
await $prevMonthBtn.trigger('click')
expect(wrapper.vm.currentMonth).toBe(new Date().getMonth() - 1)

const currentMonth = new Date().getMonth()
if (currentMonth === 0) {
expect(wrapper.vm.currentMonth).toBe(11)
} else {
expect(wrapper.vm.currentMonth).toBe(currentMonth - 1)
}
})

it('select previous year', async () => {
Expand Down

0 comments on commit 5371d0d

Please sign in to comment.