Merge branch 'master' into adminEditPendingCreationQueries

This commit is contained in:
Alexander Friedland 2021-12-06 10:01:11 +01:00 committed by GitHub
commit 0a4d87d257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 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

@ -40,6 +40,11 @@ const mocks = {
$toasted: {
error: toastedErrorMock,
},
$moment: jest.fn((value) => {
return {
format: jest.fn((format) => value),
}
}),
}
describe('CreationConfirm', () => {

View File

@ -1,11 +1,13 @@
import store, { mutations, actions } from './store'
import CONFIG from '../config'
const { token, openCreationsPlus, openCreationsMinus, resetOpenCreations } = mutations
jest.mock('../config')
const { token, openCreationsPlus, openCreationsMinus, resetOpenCreations, setOpenCreations } =
mutations
const { logout } = actions
const CONFIG = {
DEBUG_DISABLE_AUTH: true,
}
CONFIG.DEBUG_DISABLE_AUTH = true
describe('Vuex store', () => {
describe('mutations', () => {
@ -40,6 +42,14 @@ describe('Vuex store', () => {
expect(state.openCreations).toEqual(0)
})
})
describe('setOpenCreations', () => {
it('sets the open creations to given value', () => {
const state = { openCreations: 24 }
setOpenCreations(state, 12)
expect(state.openCreations).toEqual(12)
})
})
})
describe('actions', () => {