all files / tests/specs/class-style/ style.spec.js

29.41% Statements 5/17
100% Branches 0/0
100% Functions 3/3
29.41% Lines 5/17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                                           
import { resolve } from 'path';
import { renderSFCModule } from 'utils';
 
describe('CSS style', () => {
  it('style with object stynax', () => {
    const container = renderSFCModule(require('./style-object-stynax.html'));
    const testCaseDOM1 = container.querySelector('#style1');
    const testCaseDOM2 = container.querySelector('#style2');
    const computedStyle1 = getComputedStyle(testCaseDOM1);
    const computedStyle2 = getComputedStyle(testCaseDOM2);
    computedStyle1.color.should.be.colored('red');
    computedStyle1.fontSize.should.equal('30px');
    computedStyle2.color.should.be.colored('red');
    computedStyle2.fontSize.should.equal('30px');
  });
 
  it('style with array stynax', () => {
    const container = renderSFCModule(require('./style-array-stynax.html'));
    const testCaseDOM = container.querySelector('#style1');
    const computedStyle = getComputedStyle(testCaseDOM);
 
    computedStyle.color.should.be.colored('red');
    computedStyle.fontSize.should.equal('30px');
  });
});