mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-10 19:29:50 +08:00
29 lines
917 B
TypeScript
29 lines
917 B
TypeScript
import { readFileSync } from 'node:fs'
|
|
import { resolve } from 'node:path'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const source = readFileSync(
|
|
resolve(process.cwd(), 'src/views/admin/ProviderManagement.vue'),
|
|
'utf8',
|
|
)
|
|
|
|
describe('ProviderManagement detail drawer loading', () => {
|
|
it('keeps the heavy detail drawer out of the initial route chunk', () => {
|
|
expect(source).not.toContain(
|
|
"import ProviderDetailDrawer from '@/features/providers/components/ProviderDetailDrawer.vue'",
|
|
)
|
|
expect(source).toContain(
|
|
"() => import('@/features/providers/components/ProviderDetailDrawer.vue')",
|
|
)
|
|
})
|
|
|
|
it('does not resolve the async drawer until it is opened', () => {
|
|
const drawerTemplate = source
|
|
.split('<ProviderDetailDrawer')[1]
|
|
?.split('/>')[0]
|
|
|
|
expect(drawerTemplate).toBeTruthy()
|
|
expect(drawerTemplate).toContain('v-if="providerDrawerOpen"')
|
|
})
|
|
})
|