Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F24893184
NotFound.test.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
751 B
Referenced Files
None
Subscribers
None
NotFound.test.js
View Options
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
Details
Attached
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)
Attached To
Mode
rSP ServPulse
Attached
Detach File
Event Timeline
Log In to Comment