-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix styles getting injected in the classname (#500)
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/emotion/test/__snapshots__/label-pattern.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`label pattern input + label styled 1`] = ` | ||
.glamor-0 + label::after { | ||
color: pink; | ||
background: orange; | ||
} | ||
<div> | ||
<input | ||
className="glamor-0 glamor-1" | ||
/> | ||
<label> | ||
Label | ||
</label> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react' | ||
import styled from 'react-emotion' | ||
import renderer from 'react-test-renderer' | ||
import { flush } from 'emotion' | ||
|
||
describe('label pattern', () => { | ||
afterEach(() => flush()) | ||
|
||
test('input + label styled', () => { | ||
const Input = styled.input` | ||
& + label::after { | ||
color: pink; | ||
background: orange; | ||
} | ||
` | ||
|
||
const tree = renderer | ||
.create( | ||
<div> | ||
<Input /> | ||
<label>Label</label> | ||
</div> | ||
) | ||
.toJSON() | ||
|
||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |