Page MenuHomeDevCentral

NotFound.test.js
No OneTemporary

NotFound.test.js

import { mount } from '@vue/test-utils'
import { describe, it, expect } from 'vitest'
import NotFound from '../NotFound.vue'
describe('NotFound.vue', () => {
it('renders the 404 message correctly and links to home', () => {
const RouterLinkStub = {
name: 'RouterLink',
template: '<a><slot /></a>',
props: ['to'],
}
const wrapper = mount(NotFound, {
global: {
stubs: {
RouterLink: RouterLinkStub,
},
},
})
expect(wrapper.text()).toContain('404')
expect(wrapper.text()).toContain("The page you're looking for can't be found.")
const link = wrapper.findComponent(RouterLinkStub)
expect(link.exists()).toBe(true)
expect(link.props('to')).toBe('/')
})
})

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 18, 11:12 (11 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3539500
Default Alt Text
NotFound.test.js (751 B)

Event Timeline