test: button
parent
5bc6a464d5
commit
336142cfac
|
@ -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)
|
||||||
|
})
|
||||||
|
})
|
File diff suppressed because it is too large
Load Diff
|
@ -51,6 +51,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@octokit/rest": "^15.2.6",
|
"@octokit/rest": "^15.2.6",
|
||||||
"autoprefixer": "^8.1.0",
|
"autoprefixer": "^8.1.0",
|
||||||
|
"avoriaz": "^6.3.0",
|
||||||
"babel-cli": "^6.26.0",
|
"babel-cli": "^6.26.0",
|
||||||
"babel-core": "^6.26.0",
|
"babel-core": "^6.26.0",
|
||||||
"babel-eslint": "^8.0.1",
|
"babel-eslint": "^8.0.1",
|
||||||
|
|
|
@ -8,7 +8,6 @@ const webpackConfig = require('../webpack.config')
|
||||||
const merge = require('webpack-merge')
|
const merge = require('webpack-merge')
|
||||||
delete webpackConfig.entry
|
delete webpackConfig.entry
|
||||||
const scope = process.argv[5] || ''
|
const scope = process.argv[5] || ''
|
||||||
console.log('scope', process.argv)
|
|
||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
config.set({
|
config.set({
|
||||||
// to run in additional browsers:
|
// 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…
Reference in New Issue