Skip to content
Permalink
Browse files

test: add renderer SSR rule() test

  • Loading branch information...
streamich committed Mar 1, 2018
1 parent 9b21212 commit 034cd429cf70b0e71deeba2b38b7150528cdd252
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/renderer/__tests__/Renderer.test-server.ts
@@ -1,5 +1,7 @@
import Renderer from '../Renderer';
import {expect} from 'chai';
import {rule} from '../..';
import renderer from '../../renderer';

describe('Renderer SSR', () => {
it('is a function', () => {
@@ -176,4 +178,25 @@ describe('Renderer SSR', () => {
expect(rawCss.includes('width:100%')).to.be.true;
});
});

describe('rule()', () => {
it('flushes styles', () => {
let cn = rule({
bd: '1px solid red',
});

expect(renderer.flush().includes('border:1px solid red')).to.be.true;
expect(!!renderer.flush()).to.be.false;

cn = rule({
bd: '1px solid tomato',
});

const rawCss = renderer.flush();

expect(rawCss.includes('border:1px solid tomato')).to.be.true;
expect(rawCss.includes('border:1px solid red')).to.be.false;
expect(!!renderer.flush()).to.be.false;
});
});
});

0 comments on commit 034cd42

Please sign in to comment.
You can’t perform that action at this time.