1 | import React from 'react';
|
2 | import { findDOMNode, render } from 'react-dom';
|
3 | import TestUtils from 'react-addons-test-utils';
|
4 |
|
5 | const removeNewlines = (string) => (string.replace(/(\r\n|\n|\r)/gm, ''))
|
6 |
|
7 | import Style from '../src/index.js';
|
8 |
|
9 | describe('Style-01', () => {
|
10 | it('renders unscoped global CSS when <Style> does not wrap an element', () => {
|
11 |
|
12 | const wrapper = TestUtils.renderIntoDocument(
|
13 | <div>
|
14 | <Style>{`body { font-size: 13px; }`}</Style>
|
15 | </div>
|
16 | );
|
17 |
|
18 | const rootNode = findDOMNode(wrapper)
|
19 | const styleNode = rootNode.children[0];
|
20 |
|
21 |
|
22 | expect(styleNode.textContent).toEqual(`body {\n font-size: 13px; }\n`);
|
23 | });
|
24 | }); |
\ | No newline at end of file |