Browse Source

Add a test for a single at rule like a font-face

pull/803/head
Artur Arseniev 8 years ago
parent
commit
62f2a06861
  1. 11
      test/specs/css_composer/model/CssModels.js

11
test/specs/css_composer/model/CssModels.js

@ -82,14 +82,21 @@ module.exports = {
});
it('toCSS with a generic at-rule', () => {
obj.set('atRuleType', 'font-face');
obj.set('atRuleType', 'supports');
obj.get('selectors').add({ name: 'test1' });
obj.setStyle({ 'font-family': 'Open Sans' });
expect(obj.toCSS()).toEqual(
`@font-face{.test1{font-family:Open Sans;}}`
`@supports{.test1{font-family:Open Sans;}}`
);
});
it('toCSS with a generic single at-rule', () => {
obj.set('atRuleType', 'font-face');
obj.set('singleAtRule', 1);
obj.setStyle({ 'font-family': 'Sans' });
expect(obj.toCSS()).toEqual(`@font-face{font-family:Sans;}`);
});
it('toCSS with a generic at-rule and condition', () => {
obj.set('atRuleType', 'font-face');
obj.set('mediaText', 'some-condition');

Loading…
Cancel
Save