|
|
|
@ -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;}`); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|