Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
test: test for trimming classname
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowtime2000 committed Nov 25, 2020
1 parent cb6e3d5 commit 7cae8ef
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/vdom/__test__/h.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,20 @@ describe('.h', () => {
}
})
});
it('should trim the class', () => {
const vdom = h('div', undefined, { attributes: { className: ' foo bar a f random-class-here ' }, directives: {}, type: 0 });

expect(vdom).toEqual({
tag: 'div',
children: [],
props: {
attributes: {
className: 'foo bar a f random-class-here'
},
directives: {},
type: 0,
ref: undefined
}
})
})
});

0 comments on commit 7cae8ef

Please sign in to comment.