27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
import { readFileSync } from 'node:fs'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const indexPageSource = readFileSync(
|
|
fileURLToPath(new URL('../../src/pages/index/index.vue', import.meta.url)),
|
|
'utf8'
|
|
)
|
|
|
|
const launchOverlaySource = indexPageSource.slice(
|
|
indexPageSource.indexOf('v-if="launchOverlayVisible"'),
|
|
indexPageSource.indexOf('</GuidePageFrame>')
|
|
)
|
|
|
|
describe('首页精简加载页', () => {
|
|
it('仅展示图形标识、文字馆名和原生加载动效', () => {
|
|
expect(launchOverlaySource).toContain('/static/guide/museum-brand-icons.webp')
|
|
expect(launchOverlaySource).toContain('SHENZHEN NATURAL HISTORY MUSEUM')
|
|
expect(launchOverlaySource).toContain('深圳自然博物馆')
|
|
expect(launchOverlaySource).toContain('<progress')
|
|
expect(launchOverlaySource).not.toContain('app-launch-loading-lqip.webp')
|
|
expect(launchOverlaySource).not.toContain('app-launch-loading.webp')
|
|
expect(launchOverlaySource).not.toContain('app-launch-kicker')
|
|
expect(launchOverlaySource).not.toContain('app-launch-status')
|
|
})
|
|
})
|