import { storeToRefs } from 'pinia'; import { useDrawerStore } from '@/stores/drawer.store'; import { mountAndFakePiniaWrapper } from '@test/plugins/pinia'; describe('drawer store', () => { it('should be closed when home', () => { mountAndFakePiniaWrapper(); const { activeDrawer, isOpen } = storeToRefs(useDrawerStore()); expect(activeDrawer.value).toBe('home'); expect(isOpen.value).toBeFalsy(); }); it('should be open when not home', () => { mountAndFakePiniaWrapper(); const { activeDrawer, isOpen } = storeToRefs(useDrawerStore()); activeDrawer.value = 'annotations'; expect(isOpen.value).toBeTruthy(); expect(activeDrawer.value).toBe('annotations'); }); it('should be home when not set', () => { mountAndFakePiniaWrapper(); const { activeDrawer } = storeToRefs(useDrawerStore()); activeDrawer.value = ''; expect(activeDrawer.value).toBe('home'); }); });