mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-05-06 06:00:44 +08:00
fix: honor table defaults and preserve dispatch mappings
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
|
||||
import { getPersistedPageSize } from '@/composables/usePersistedPageSize'
|
||||
|
||||
describe('usePersistedPageSize', () => {
|
||||
afterEach(() => {
|
||||
localStorage.clear()
|
||||
delete window.__APP_CONFIG__
|
||||
})
|
||||
|
||||
it('uses the system table default instead of stale localStorage state', () => {
|
||||
window.__APP_CONFIG__ = {
|
||||
table_default_page_size: 1000,
|
||||
table_page_size_options: [20, 50, 1000]
|
||||
} as any
|
||||
localStorage.setItem('table-page-size', '50')
|
||||
localStorage.setItem('table-page-size-source', 'user')
|
||||
|
||||
expect(getPersistedPageSize()).toBe(1000)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user