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