Browse Source

added unit testing to dump unused css selectors

pull/1054/head
Arthur Almeida 8 years ago
parent
commit
e8e76476b9
  1. 11
      test/specs/grapesjs/index.js

11
test/specs/grapesjs/index.js

@ -376,5 +376,16 @@ describe('GrapesJS', () => {
editor = obj.init(config);
expect(editor.Commands.get('export-template').test).toEqual(1);
});
it('Dump unused css classes/selectors', () => {
config.fromElement = 1;
config.storageManager = { type: 0 };
fixture.innerHTML = documentEl;
const editor = obj.init(config);
const css = editor.getCss({ dumpUnusedSelectors: 1 });
const protCss = editor.getConfig().protectedCss;
expect(editor.getStyle().length).toEqual(2);
expect(css).toEqual(`${protCss}.test2{color:red;}.test3{color:blue;}`);
});
});
});

Loading…
Cancel
Save