import { ScanView, ViewSelectionActions } from '@3cr/types-ts'; import { mount } from '@vue/test-utils'; import ResetViewAction from '@/components/modal/actions/ResetViewAction.vue'; import { useViewer3cr } from '@/composables/useViewer3cr'; describe('ResetViewAction tests', () => { const viewer3cr = useViewer3cr(); const viewSelectionSpy = vi .spyOn(viewer3cr, 'viewSelection') .mockResolvedValue(); it('should reset view', async () => { const props = { view: ScanView.Volume }; const wrapper = mount(ResetViewAction, { props }); const button = wrapper.findComponentByTestId('button'); await button.trigger('click'); expect(viewSelectionSpy).toHaveBeenCalledWith(ViewSelectionActions.vs06); expect(viewSelectionSpy).toHaveBeenCalledWith(ViewSelectionActions.vs05); }); });