UNPKG

729 BJavaScriptView Raw
1import React from 'react';
2import { findDOMNode, render } from 'react-dom';
3import TestUtils from 'react-addons-test-utils';
4
5const removeNewlines = (string) => (string.replace(/(\r\n|\n|\r)/gm, ''))
6
7import Style from '../src/index.js';
8
9describe('Style-01', () => {
10 it('renders unscoped global CSS when <Style> does not wrap an element', () => {
11 // Render a styles in the document
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 // Verify that stylecontent
22 expect(styleNode.textContent).toEqual(`body {\n font-size: 13px; }\n`);
23 });
24});
\No newline at end of file