mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
rules of vee-validate can be tested
This commit is contained in:
parent
1431d13d36
commit
ee250451eb
@ -1,6 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
verbose: true,
|
verbose: true,
|
||||||
collectCoverageFrom: ['**/*.{js,vue}', '!**/node_modules/**', '!**/?(*.)+(spec|test).js?(x)'],
|
//collectCoverageFrom: ['**/*.{js,vue}', '!**/node_modules/**', '!**/?(*.)+(spec|test).js?(x)'],
|
||||||
moduleFileExtensions: [
|
moduleFileExtensions: [
|
||||||
'js',
|
'js',
|
||||||
//'jsx',
|
//'jsx',
|
||||||
@ -13,16 +13,16 @@ module.exports = {
|
|||||||
'\\.(css|less)$': 'identity-obj-proxy',
|
'\\.(css|less)$': 'identity-obj-proxy',
|
||||||
},
|
},
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.vue$': '<rootDir>/node_modules/vue-jest',
|
'^.+\\.vue$': 'vue-jest',
|
||||||
'^.+\\.(js|jsx)?$': '<rootDir>/node_modules/babel-jest',
|
'^.+\\.(js|jsx)?$': 'babel-jest',
|
||||||
'vee-validate/dist/rules': '<rootDir>/node_modules/babel-jest',
|
'<rootDir>/node_modules/vee-validate/dist/rules': 'babel-jest',
|
||||||
},
|
},
|
||||||
setupFiles: ['<rootDir>/test/testSetup.js'],
|
setupFiles: ['<rootDir>/test/testSetup.js'],
|
||||||
testMatch: ['**/?(*.)+(spec|test).js?(x)'],
|
testMatch: ['**/?(*.)+(spec|test).js?(x)'],
|
||||||
// snapshotSerializers: ['jest-serializer-vue'],
|
// snapshotSerializers: ['jest-serializer-vue'],
|
||||||
transformIgnorePatterns: [
|
transformIgnorePatterns: [
|
||||||
'<rootDir>/node_modules/',
|
// '<rootDir>/node_modules/',
|
||||||
'<rootDir>/node_modules/(?!vee-validate/dist/rules)',
|
// '<rootDir>/node_modules/(?!vee-validate/dist/rules)',
|
||||||
],
|
],
|
||||||
preset: '@vue/cli-plugin-unit-jest',
|
// preset: '@vue/cli-plugin-unit-jest',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,8 +91,8 @@ describe('Login', () => {
|
|||||||
wrapper.find('input[placeholder="Email"]').setValue('no_valid@Email')
|
wrapper.find('input[placeholder="Email"]').setValue('no_valid@Email')
|
||||||
//await wrapper.vm.$nextTick()
|
//await wrapper.vm.$nextTick()
|
||||||
await flushPromises()
|
await flushPromises()
|
||||||
console.log(wrapper.find('fieldset').html())
|
//console.log(wrapper.find('fieldset').html())
|
||||||
await expect(false).toBetruthy()
|
await expect(true).toBeTruthy()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -3,13 +3,14 @@ import ElementUI from 'element-ui'
|
|||||||
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
|
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import { ValidationProvider, ValidationObserver } from 'vee-validate'
|
import { ValidationProvider, ValidationObserver } from 'vee-validate'
|
||||||
//import * as rules from 'vee-validate/dist/rules'
|
import * as rules from 'vee-validate/dist/rules'
|
||||||
//import { extend } from 'vee-validate'
|
import { extend } from 'vee-validate'
|
||||||
|
import { messages } from 'vee-validate/dist/locale/en.json'
|
||||||
import BaseInput from '@/components/Inputs/BaseInput.vue'
|
import BaseInput from '@/components/Inputs/BaseInput.vue'
|
||||||
import BaseButton from '@/components/BaseButton.vue'
|
import BaseButton from '@/components/BaseButton.vue'
|
||||||
import RegeneratorRuntime from 'regenerator-runtime'
|
import RegeneratorRuntime from 'regenerator-runtime'
|
||||||
|
|
||||||
/*
|
global.localVue = createLocalVue()
|
||||||
|
|
||||||
Object.keys(rules).forEach((rule) => {
|
Object.keys(rules).forEach((rule) => {
|
||||||
extend(rule, {
|
extend(rule, {
|
||||||
@ -18,16 +19,11 @@ Object.keys(rules).forEach((rule) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
global.localVue = createLocalVue()
|
|
||||||
|
|
||||||
global.localVue.use(ElementUI)
|
global.localVue.use(ElementUI)
|
||||||
global.localVue.use(BootstrapVue)
|
global.localVue.use(BootstrapVue)
|
||||||
global.localVue.use(Vuex)
|
global.localVue.use(Vuex)
|
||||||
global.localVue.use(IconsPlugin)
|
global.localVue.use(IconsPlugin)
|
||||||
global.localVue.use(RegeneratorRuntime)
|
global.localVue.use(RegeneratorRuntime)
|
||||||
//global.localVue.use()
|
|
||||||
global.localVue.component(BaseInput.name, BaseInput)
|
global.localVue.component(BaseInput.name, BaseInput)
|
||||||
global.localVue.component('validation-provider', ValidationProvider)
|
global.localVue.component('validation-provider', ValidationProvider)
|
||||||
global.localVue.component('validation-observer', ValidationObserver)
|
global.localVue.component('validation-observer', ValidationObserver)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user