Skip to content

Commit

Permalink
+ Add unit testing for attrs.
Browse files Browse the repository at this point in the history
For merge request #15.
For Vue attrs, please read: https://github.com/vuejs/jsx-vue2#attributesprops
  • Loading branch information
LancerComet committed Nov 18, 2023
1 parent a0e9b77 commit e5a85dd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/attrs.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ describe('HTML testing.', () => {

const wrapper = shallowMount(Comp)
})

it('Should support attr spread operator.', () => {
const wrapper = shallowMount({
setup () {
const attrs = {
type: 'email',
placeholder: 'Enter your email'
}

return () => (
<input { ...{ attrs } } />
)
}
})
expect(wrapper.html()).toBe('<input type="email" placeholder="Enter your email">')
})
})

describe('Vue component testing.', () => {
Expand Down

0 comments on commit e5a85dd

Please sign in to comment.