Merge branch 'admin_pending_creation' into adminPendingCreationQueries

This commit is contained in:
elweyn 2021-11-30 08:29:26 +01:00
commit 65461130bb
2 changed files with 39 additions and 1 deletions

View File

@ -441,7 +441,7 @@ jobs:
report_name: Coverage Admin Interface
type: lcov
result_path: ./coverage/lcov.info
min_coverage: 51
min_coverage: 52
token: ${{ github.token }}
##############################################################################

View File

@ -3,11 +3,19 @@ import NavBar from './NavBar.vue'
const localVue = global.localVue
const storeDispatchMock = jest.fn()
const routerPushMock = jest.fn()
const mocks = {
$store: {
state: {
openCreations: 1,
token: 'valid-token',
},
dispatch: storeDispatchMock,
},
$router: {
push: routerPushMock,
},
}
@ -27,4 +35,34 @@ describe('NavBar', () => {
expect(wrapper.find('.component-nabvar').exists()).toBeTruthy()
})
})
describe('wallet', () => {
const assignLocationSpy = jest.fn()
beforeEach(async () => {
await wrapper.findAll('a').at(5).trigger('click')
})
it.skip('changes widnow location to wallet', () => {
expect(assignLocationSpy).toBeCalledWith('valid-token')
})
it('dispatches logout to store', () => {
expect(storeDispatchMock).toBeCalledWith('logout')
})
})
describe('logout', () => {
// const assignLocationSpy = jest.fn()
beforeEach(async () => {
await wrapper.findAll('a').at(6).trigger('click')
})
it('redirects to /logout', () => {
expect(routerPushMock).toBeCalledWith('/logout')
})
it('dispatches logout to store', () => {
expect(storeDispatchMock).toBeCalledWith('logout')
})
})
})