diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75fd46a08..1e8d53acc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -344,7 +344,7 @@ jobs: report_name: Coverage Frontend type: lcov result_path: ./coverage/lcov.info - min_coverage: 83 + min_coverage: 85 token: ${{ github.token }} ############################################################################## diff --git a/frontend/jest.config.js b/frontend/jest.config.js index dc44ca43e..774aa6bf9 100644 --- a/frontend/jest.config.js +++ b/frontend/jest.config.js @@ -9,8 +9,9 @@ module.exports = { ], // coverageReporters: ['lcov', 'text'], moduleNameMapper: { - '^@/(.*)$': '/src/$1', '\\.(css|less)$': 'identity-obj-proxy', + '\\.(scss)$': '/src/assets/mocks/styleMock.js', + '^@/(.*)$': '/src/$1', }, transform: { '^.+\\.vue$': 'vue-jest', diff --git a/frontend/src/assets/mocks/styleMock.js b/frontend/src/assets/mocks/styleMock.js new file mode 100644 index 000000000..4ba52ba2c --- /dev/null +++ b/frontend/src/assets/mocks/styleMock.js @@ -0,0 +1 @@ +module.exports = {} diff --git a/frontend/src/plugins/dashboard-plugin.test.js b/frontend/src/plugins/dashboard-plugin.test.js new file mode 100644 index 000000000..3792ad2c4 --- /dev/null +++ b/frontend/src/plugins/dashboard-plugin.test.js @@ -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) + }) +})