diff --git a/tests/unit/components/Qalendar.test.ts b/tests/unit/components/Qalendar.test.ts index c7735ad4..3dec91a1 100644 --- a/tests/unit/components/Qalendar.test.ts +++ b/tests/unit/components/Qalendar.test.ts @@ -480,4 +480,15 @@ describe('Qalendar.vue', () => { month.vm.$emit('updated-period', { start: new Date(), end: new Date(), selectedDate: new Date() }) expect(wrapper.vm.mode).toBe('day') }) + + it('should go to invoke the goToPeriod in the header and go forward in time', () => { + const wrapper = mount(Qalendar) + const header = wrapper.findComponent({ name: 'AppHeader' }) + const goToPeriodSpy = vi.spyOn(header.vm, 'goToPeriod') + const expectedDirection = 'forward' + + wrapper.vm.goToPeriod(expectedDirection) + + expect(goToPeriodSpy).toHaveBeenCalledWith(expectedDirection) + }) })