Changes to the Login so that the new logic is tested.

This commit is contained in:
elweyn 2021-10-06 08:40:41 +02:00
parent dde7bb292f
commit 3a5d34a31d
2 changed files with 14 additions and 1 deletions

View File

@ -86,6 +86,19 @@ describe('Login', () => {
}) })
}) })
describe('communities gives back error', () => {
beforeEach(() => {
apolloQueryMock.mockRejectedValue({
message: 'Failed to get communities',
})
wrapper = new Wrapper()
})
it('toasts an error message', () => {
expect(toastErrorMock).toBeCalledWith('Failed to get communities')
})
})
describe('Login header', () => { describe('Login header', () => {
it('has a welcome message', () => { it('has a welcome message', () => {
expect(wrapper.find('div.header').text()).toBe('Gradido site.login.community') expect(wrapper.find('div.header').text()).toBe('Gradido site.login.community')

View File

@ -121,7 +121,7 @@ export default {
this.$store.commit('community', result.data.getCommunityInfo) this.$store.commit('community', result.data.getCommunityInfo)
}) })
.catch((error) => { .catch((error) => {
this.$toasted.error(error) this.$toasted.error(error.message)
}) })
}, },
}, },