test: button

pull/165/head
tjz 7 years ago
parent a471c1c7cf
commit d6a3208c06

@ -1,14 +0,0 @@
import Vue from 'vue'
import Button from '../index'
describe('Button.vue', () => {
it('should render correct contents', () => {
const Constructor = Vue.extend(Button)
const ele = document.createElement('div')
document.body.appendChild(ele)
const vm = new Constructor({ propsData: { type: 'primary' }})
vm.$mount(ele)
expect(vm.$el.classList.contains('ant-btn-primary'))
.to.equal(true)
})
})

@ -0,0 +1,18 @@
import Button from '../index'
import {mount} from 'avoriaz'
describe('Button', () => {
let wrapper
afterEach(() => {
wrapper && wrapper.destroy()
})
it('create primary button', () => {
wrapper = mount(Button, {
propsData: {
type: 'primary',
},
})
expect(wrapper.hasClass('ant-btn-primary')).to.equal(true)
})
})

1468
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -51,6 +51,7 @@
"devDependencies": {
"@octokit/rest": "^15.2.6",
"autoprefixer": "^8.1.0",
"avoriaz": "^6.3.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.1",
@ -163,4 +164,4 @@
"vue-types": "^1.0.2",
"warning": "^3.0.0"
}
}
}

@ -8,7 +8,6 @@ const webpackConfig = require('../webpack.config')
const merge = require('webpack-merge')
delete webpackConfig.entry
const scope = process.argv[5] || ''
console.log('scope', process.argv)
module.exports = function (config) {
config.set({
// to run in additional browsers:

@ -1,14 +0,0 @@
import Vue from 'vue'
import Button from '../../components/button'
describe('Button.vue', () => {
it('should render correct contents', () => {
const Constructor = Vue.extend(Button)
const ele = document.createElement('div')
document.body.appendChild(ele)
const vm = new Constructor({ propsData: { type: 'primary' }})
vm.$mount(ele)
expect(vm.$el.classList.contains('ant-btn-primary'))
.to.equal(true)
})
})
Loading…
Cancel
Save