forked from npmx-dev/npmx.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppFooter.spec.ts
More file actions
29 lines (27 loc) · 1.04 KB
/
AppFooter.spec.ts
File metadata and controls
29 lines (27 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { describe, expect, it } from 'vitest'
import { mountSuspended } from '@nuxt/test-utils/runtime'
import AppFooter from '~/components/AppFooter.vue'
describe('AppFooter', () => {
it('BuildEnvironment is properly displayed at settings', async () => {
const buildInfo = useAppConfig().buildInfo
const component = await mountSuspended(AppFooter, {
route: '/settings',
})
const html = component.html()
expect(html).toContain(`<span class="tracking-wider">${buildInfo.env}</span>`)
expect(html).toContain(
`<a href="https://github.com/npmx-dev/npmx.dev/commit/${buildInfo.commit}"`,
)
})
it('BuildEnvironment is hidden at home', async () => {
const buildInfo = useAppConfig().buildInfo
const component = await mountSuspended(AppFooter, {
route: '/',
})
const html = component.html()
expect(html).not.toContain(
`<a href="https://github.com/npmx-dev/npmx.dev/commit/${buildInfo.commit}"`,
)
expect(html).not.toContain(`<span class="tracking-wider">${buildInfo.env}</span>`)
})
})