yarn test fixed

This commit is contained in:
ogerly 2022-02-17 09:57:52 +01:00
parent ed6ee0f823
commit f7fa134346
2 changed files with 14 additions and 3 deletions

View File

@ -3,11 +3,15 @@ import NotFoundPage from './NotFoundPage'
const localVue = global.localVue
const mocks = {
$t: jest.fn((t) => t),
}
describe('NotFoundPage', () => {
let wrapper
const Wrapper = () => {
return mount(NotFoundPage, { localVue })
return mount(NotFoundPage, { localVue, mocks })
}
describe('mount', () => {
@ -16,7 +20,11 @@ describe('NotFoundPage', () => {
})
it('has a svg', () => {
expect(wrapper.find('svg').exists()).toBeTruthy()
expect(wrapper.find('svg.test-404').exists()).toBeTruthy()
})
it('has a back button', () => {
expect(wrapper.find('.test-back').exists()).toBeTruthy()
})
})
})

View File

@ -9,6 +9,7 @@
<div class="row">
<div class="col-sm-12 col-md-12 mt-5 mb-5">
<svg
class="test-404"
width="100%"
height="auto"
viewBox="0 0 636 324"
@ -1186,7 +1187,9 @@
</b-container>
</div>
<div class="text-center">
<b-button variant="light" @click="$router.go(-1)">{{ $t('back') }}</b-button>
<b-button class="test-back" variant="light" @click="$router.go(-1)">
{{ $t('back') }}
</b-button>
</div>
</div>
</template>