Skip to content

Commit

Permalink
test: fix class order
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea authored and yyx990803 committed Dec 9, 2019
1 parent 14aaffe commit 773406a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/runtime-dom/__tests__/modules/class.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,24 @@ describe('class', () => {
return () => h(child2, { class: ['a', parentClass.value] })
}
}
const aaa = h(parent)
const bbb = h(parent2)
console.log(aaa, bbb)

render(h(parent2), root)
expect(root.children[0].className).toBe('c d a b')

render(h(parent), root)
expect(root.children[0].className).toBe('c a d b')
expect(root.children[0].className).toBe('c d a b')

parentClass.value = 'e'
render(h(parent), root)
expect(root.children[0].className).toBe('c a d e')
expect(root.children[0].className).toBe('c d a e')

parentClass.value = 'f'
render(h(parent), root)
expect(root.children[0].className).toBe('c a f e')
expect(root.children[0].className).toBe('c f a e')

parentClass.value = { foo: true }
childClass.value = ['bar', 'baz']
expect(root.children[0].className).toBe('c a bar baz foo')
expect(root.children[0].className).toBe('c bar baz a foo')
})

test('class merge between multiple nested components sharing same element', () => {
Expand Down

0 comments on commit 773406a

Please sign in to comment.