Skip to content

Commit

Permalink
test(coverage): add test for serializing html strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Mar 16, 2018
1 parent ae25541 commit d626d95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/__tests__/__snapshots__/serializer.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,14 @@ exports[`works when the root element does not have styles 1`] = `
/>
</div>
`;

exports[`works with strings 1`] = `
.css-0,
[data-css-0] {
margin: 10px;
}
<div
class="css-0"
/>
`;
6 changes: 6 additions & 0 deletions src/__tests__/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ test(`doesn't mess up stuff that does't have styles`, () => {
expect(tree).toMatchSnapshot()
})

test('works with strings', () => {
const className = glamor.css({margin: 10})
const html = `<div class="${className}"></div>`
expect(html).toMatchSnapshot()
})

test(`doesn't mess up stuff when styles have a child selector`, () => {
const style = glamor.css({
'> div': {
Expand Down

0 comments on commit d626d95

Please sign in to comment.