mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
test dashboard plugin to increase coverage
This commit is contained in:
parent
c3572a0c4b
commit
fc0dafeeb8
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -344,7 +344,7 @@ jobs:
|
|||||||
report_name: Coverage Frontend
|
report_name: Coverage Frontend
|
||||||
type: lcov
|
type: lcov
|
||||||
result_path: ./coverage/lcov.info
|
result_path: ./coverage/lcov.info
|
||||||
min_coverage: 83
|
min_coverage: 85
|
||||||
token: ${{ github.token }}
|
token: ${{ github.token }}
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|||||||
@ -9,8 +9,9 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
// coverageReporters: ['lcov', 'text'],
|
// coverageReporters: ['lcov', 'text'],
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'^@/(.*)$': '<rootDir>/src/$1',
|
|
||||||
'\\.(css|less)$': 'identity-obj-proxy',
|
'\\.(css|less)$': 'identity-obj-proxy',
|
||||||
|
'\\.(scss)$': '<rootDir>/src/assets/mocks/styleMock.js',
|
||||||
|
'^@/(.*)$': '<rootDir>/src/$1',
|
||||||
},
|
},
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.vue$': 'vue-jest',
|
'^.+\\.vue$': 'vue-jest',
|
||||||
|
|||||||
1
frontend/src/assets/mocks/styleMock.js
Normal file
1
frontend/src/assets/mocks/styleMock.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
module.exports = {}
|
||||||
25
frontend/src/plugins/dashboard-plugin.test.js
Normal file
25
frontend/src/plugins/dashboard-plugin.test.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import dashboardPlugin from './dashboard-plugin.js'
|
||||||
|
import Vue from 'vue'
|
||||||
|
|
||||||
|
import GlobalComponents from './globalComponents'
|
||||||
|
import GlobalDirectives from './globalDirectives'
|
||||||
|
|
||||||
|
jest.mock('./globalComponents')
|
||||||
|
jest.mock('./globalDirectives')
|
||||||
|
|
||||||
|
jest.mock('vue')
|
||||||
|
|
||||||
|
const vueUseMock = jest.fn()
|
||||||
|
Vue.use = vueUseMock
|
||||||
|
|
||||||
|
describe('dashboard plugin', () => {
|
||||||
|
dashboardPlugin.install(Vue)
|
||||||
|
|
||||||
|
it('installs the global components', () => {
|
||||||
|
expect(vueUseMock).toBeCalledWith(GlobalComponents)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('installs the global directives', () => {
|
||||||
|
expect(vueUseMock).toBeCalledWith(GlobalDirectives)
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user