Skip to content

Commit

Permalink
update(test): cascade picker warn test
Browse files Browse the repository at this point in the history
  • Loading branch information
dolymood committed Jan 16, 2018
1 parent b3d854f commit 35248d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/unit/specs/cascade-picker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,19 @@ describe('CascadePicker', () => {
.to.equal(cascadeData[1].children[1].children[0].value)
})

it('should add warn log when sigle is true', () => {
const app = new Vue()
const originWarn = console.warn
const msgs = []
console.warn = function (...args) {
msgs.push(args.join('#'))
}
vm = app.$createCascadePicker({}, true)
expect(msgs.length)
.to.equal(1)
console.warn = originWarn
})

function createCascadePicker(props = {}, events = {}) {
return instantiateComponent(Vue, CascadePicker, {
props: props,
Expand Down

0 comments on commit 35248d0

Please sign in to comment.