Merge pull request #1515 from gradido/1466-404-Page-needs-Back-to-Login-Button

404 page needs back to login button
This commit is contained in:
Alexander Friedland 2022-02-17 10:58:18 +01:00 committed by GitHub
commit d63f93149c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 4 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', () => {
@ -18,5 +22,9 @@ describe('NotFoundPage', () => {
it('has a svg', () => {
expect(wrapper.find('svg').exists()).toBeTruthy()
})
it('has a back button', () => {
expect(wrapper.find('.test-back').exists()).toBeTruthy()
})
})
})

View File

@ -4,7 +4,7 @@
<div class="header py-1 py-lg-1 pt-lg-3">
<b-container>
<div class="header-body text-center mb-3">
<a href="login" to="login">
<a href="#!" @click="goback">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 mt-5 mb-5">
@ -1185,6 +1185,11 @@
</div>
</b-container>
</div>
<div class="text-center">
<b-button class="test-back" variant="light" @click="goback">
{{ $t('back') }}
</b-button>
</div>
</div>
</template>
@ -1213,6 +1218,11 @@ export default {
},
}
},
methods: {
goback() {
this.$router.go(-1)
},
},
}
</script>
<style>

View File

@ -1,5 +1,6 @@
{
"all_emails": "Alle Nutzer",
"back": "zurück",
"bookmark": "bookmark",
"confirmed": "bestätigt",
"creation": "Schöpfung",

View File

@ -1,5 +1,6 @@
{
"all_emails": "All users",
"back": "back",
"bookmark": "Remember",
"confirmed": "confirmed",
"creation": "Creation",

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', () => {
@ -18,5 +22,9 @@ describe('NotFoundPage', () => {
it('has a svg', () => {
expect(wrapper.find('svg').exists()).toBeTruthy()
})
it('has a back button', () => {
expect(wrapper.find('.test-back').exists()).toBeTruthy()
})
})
})

View File

@ -4,7 +4,7 @@
<div class="header py-1 py-lg-1 pt-lg-3">
<b-container>
<div class="header-body text-center mb-3">
<a href="login" to="login">
<a href="#!" @click="goback">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 mt-5 mb-5">
@ -1185,6 +1185,11 @@
</div>
</b-container>
</div>
<div class="text-center">
<b-button class="test-back" variant="light" @click="goback">
{{ $t('back') }}
</b-button>
</div>
</div>
</template>
@ -1213,6 +1218,11 @@ export default {
},
}
},
methods: {
goback() {
this.$router.go(-1)
},
},
}
</script>
<style>