このコミットが含まれているのは:
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { useSharedTransitionStore } from '@/stores/sharedTransitionStore'
|
||||
|
||||
describe ('useSharedTransitionStore', () => {
|
||||
it ('sets and clears shared ids per location key', () => {
|
||||
useSharedTransitionStore.setState ({ byLocationKey: {} })
|
||||
|
||||
useSharedTransitionStore.getState ().setForLocationKey ('loc-1', 'page-1')
|
||||
useSharedTransitionStore.getState ().setForLocationKey ('loc-2', 'page-2')
|
||||
|
||||
expect (useSharedTransitionStore.getState ().byLocationKey).toEqual ({
|
||||
'loc-1': 'page-1',
|
||||
'loc-2': 'page-2',
|
||||
})
|
||||
|
||||
useSharedTransitionStore.getState ().clearForLocationKey ('loc-1')
|
||||
|
||||
expect (useSharedTransitionStore.getState ().byLocationKey).toEqual ({
|
||||
'loc-2': 'page-2',
|
||||
})
|
||||
})
|
||||
})
|
||||
新しい課題から参照
ユーザをブロックする