Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

Commit

Permalink
Update testcase example
Browse files Browse the repository at this point in the history
`eql`이 순서에도 민감하게 검사를 해서
순서에 상관없는 `containDeep`로 수정하였습니다.

`containDeep`은 포함되어 있는지만 확인 하기 때문에
좀 더 정확하게 같은지를 확인하기 위해서 `length`를 사용하였습니다.
  • Loading branch information
cmd-shift-s committed Mar 2, 2017
1 parent c795bde commit 68d60a8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test/unit/specs/elements/Button.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,30 @@ describe('Button.vue', () => {
const newVM = utils.newVM(Button)
it('default className', () => {
const vm = newVM()
vm.$.classes().should.be.eql(['ui', 'button'])

const cx = ['ui', 'button']
vm.$.classes().should.containDeep(cx)
})

it('should have red', () => {
const vm = newVM({
color: 'red'
})
vm.$.classes().should.be.eql(['ui', 'button', 'red'])

const cx = ['ui', 'red', 'button']
vm.$.classes().should.containDeep(cx).which.length(cx.length)
})

it('should have icon', () => {
const vm = newVM({
icon: 'sign in'
})
vm.$.classes().should.be.eql(['ui', 'button', 'icon'])

const cx = ['ui', 'icon', 'button']
vm.$.classes().should.containDeep(cx).which.length(cx.length)

const $i = vm.$.children('i')
$i.classes().should.be.eql(['icon', 'sign', 'in'])
const iconCx = ['icon', 'sign', 'in']
$i.classes().should.containDeep(iconCx).which.length(iconCx.length)
})
})

0 comments on commit 68d60a8

Please sign in to comment.