Spaces:
Paused
Paused
Download web/src/__tests__/views/NotFoundView.spec.ts from stremio-db/a: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/stremio-db/a/resolve/main/web/src/__tests__/views/NotFoundView.spec.ts
- Command line
-
hf download hf://spaces/stremio-db/a/web/src/__tests__/views/NotFoundView.spec.ts
-
curl -L -o NotFoundView.spec.ts https://huggingface.co/spaces/stremio-db/a/resolve/main/web/src/__tests__/views/NotFoundView.spec.ts
1.06 kB
| import { describe, it, expect } from 'vitest' | |
| import { shallowMount } from '@vue/test-utils' | |
| import NotFoundView from '@/views/NotFoundView.vue' | |
| import NavButtons from '@/components/NavButtons.vue' | |
| describe('NotFoundView', () => { | |
| function mountView() { | |
| return shallowMount(NotFoundView, { | |
| global: { | |
| stubs: { | |
| 'router-link': { | |
| template: '<a :href="to"><slot /></a>', | |
| props: ['to'], | |
| }, | |
| }, | |
| }, | |
| }) | |
| } | |
| it('renders 404 heading', () => { | |
| const wrapper = mountView() | |
| expect(wrapper.find('h1').text()).toBe('404') | |
| }) | |
| it('renders descriptive message', () => { | |
| const wrapper = mountView() | |
| expect(wrapper.text()).toContain("didn't make the final cut") | |
| }) | |
| it('renders NavButtons with Go home link', () => { | |
| const wrapper = mountView() | |
| const navButtons = wrapper.findComponent(NavButtons) | |
| expect(navButtons.exists()).toBe(true) | |
| expect(navButtons.props('primaryLabel')).toBe('Go home') | |
| expect(navButtons.props('primaryTo')).toBe('/') | |
| }) | |
| }) | |