remove verify login call

This commit is contained in:
Moriz Wahl 2021-12-06 10:59:38 +01:00
parent cb0c9c115b
commit 19e2436452
2 changed files with 1 additions and 38 deletions

View File

@ -3,14 +3,6 @@ import EditCreationFormular from './EditCreationFormular.vue'
const localVue = global.localVue
const apolloMock = jest.fn().mockResolvedValue({
data: {
verifyLogin: {
name: 'success',
id: 0,
},
},
})
const apolloMutateMock = jest.fn().mockResolvedValue({
data: {
updatePendingCreation: {
@ -21,6 +13,7 @@ const apolloMutateMock = jest.fn().mockResolvedValue({
},
},
})
const stateCommitMock = jest.fn()
const mocks = {
@ -35,7 +28,6 @@ const mocks = {
}
}),
$apollo: {
query: apolloMock,
mutate: apolloMutateMock,
},
$store: {
@ -67,23 +59,6 @@ describe('EditCreationFormular', () => {
expect(wrapper.find('.component-edit-creation-formular').exists()).toBeTruthy()
})
describe('server sends back moderator data', () => {
it('called store commit with mocked data', () => {
expect(stateCommitMock).toBeCalledWith('moderator', { name: 'success', id: 0 })
})
})
describe('server throws error for moderator data call', () => {
beforeEach(() => {
jest.clearAllMocks()
apolloMock.mockRejectedValue({ message: 'Ouch!' })
wrapper = Wrapper()
})
it('has called store commit with fake data', () => {
expect(stateCommitMock).toBeCalledWith('moderator', { id: 0, name: 'Test Moderator' })
})
})
describe('radio buttons to selcet month', () => {
it('has three radio buttons', () => {
expect(wrapper.findAll('input[type="radio"]').length).toBe(3)

View File

@ -120,7 +120,6 @@
</template>
<script>
import { updatePendingCreation } from '../graphql/updatePendingCreation'
import { verifyLogin } from '../graphql/verifyLogin'
export default {
name: 'EditCreationFormular',
props: {
@ -167,7 +166,6 @@ export default {
},
},
created() {
this.searchModeratorData()
if (this.pagetype === 'PageCreationConfirm' && this.creationUserData.date) {
switch (this.$moment(this.creationUserData.date).format('MMMM')) {
case this.currentMonth.short:
@ -283,15 +281,5 @@ export default {
})
},
},
searchModeratorData() {
this.$apollo
.query({ query: verifyLogin })
.then((result) => {
this.$store.commit('moderator', result.data.verifyLogin)
})
.catch(() => {
this.$store.commit('moderator', { id: 0, name: 'Test Moderator' })
})
},
}
</script>