Browse Source

Add headless style test

pull/3671/head
Artur Arseniev 5 years ago
parent
commit
f28afa90c0
  1. 12
      test/specs/grapesjs/headless.js

12
test/specs/grapesjs/headless.js

@ -34,6 +34,16 @@ describe('GrapesJS Headless', () => {
expect(editor.getCss()).toBe(editor.getConfig().protectedCss); // same as default
});
test('Add styles', () => {});
test('Add styles', () => {
const res = editor.addStyle({
selectors: [{ name: 'gjs-row' }],
style: { color: 'red' }
});
expect(res.length).toBe(1);
const rule = res[0];
const result = '.gjs-row{color:red;}';
expect(rule.toCSS()).toBe(result);
expect(editor.Selectors.getAll().length).toBe(1); // 1 selector is created
});
});
});

Loading…
Cancel
Save