diff --git a/test/specs/grapesjs/headless.js b/test/specs/grapesjs/headless.js index a9c3a0ac8..0e400d1db 100644 --- a/test/specs/grapesjs/headless.js +++ b/test/specs/grapesjs/headless.js @@ -13,12 +13,13 @@ describe('GrapesJS Headless', () => { let editor; const cmpObj = { attributes: { class: 'cls', test: 'value' }, - components: { type: 'textnode', content: 'Test' } + components: { type: 'textnode', content: 'Test' }, }; const cmpStr = '
Test
'; + const fullHtml = `${cmpStr}`; const styleObj = { selectors: [{ name: 'cls' }], - style: { color: 'red' } + style: { color: 'red' }, }; const styleStr = '.cls{color:red;}'; @@ -37,7 +38,7 @@ describe('GrapesJS Headless', () => { expect(comp.toHTML()).toBe(cmpStr); expect(editor.Selectors.getAll().length).toBe(1); // 1 selector is created expect(editor.Css.getAll().length).toBe(0); // No CSS - expect(editor.getHtml()).toBe(cmpStr); + expect(editor.getHtml()).toBe(fullHtml); expect(editor.getCss()).toBe(''); // same as default }); @@ -55,10 +56,10 @@ describe('GrapesJS Headless', () => { copyable: false, selectable: true, content: 'Hello!', - _innertext: false - } - ] - } + _innertext: false, + }, + ], + }, ]); expect(res.length).toBe(1); const resHtml = '

Hello!

'; @@ -66,7 +67,7 @@ describe('GrapesJS Headless', () => { expect(comp.toHTML()).toBe(resHtml); expect(editor.Selectors.getAll().length).toBe(0); expect(editor.Css.getAll().length).toBe(0); - expect(editor.getHtml()).toBe(resHtml); + expect(editor.getHtml()).toBe(`${resHtml}`); expect(editor.getCss()).toBe(''); }); @@ -81,10 +82,10 @@ describe('GrapesJS Headless', () => { test('Load data', () => { editor.loadData({ components: [cmpObj], - styles: [styleObj] + styles: [styleObj], }); expect(editor.Selectors.getAll().length).toBe(1); - expect(editor.getHtml()).toBe(cmpStr); + expect(editor.getHtml()).toBe(fullHtml); expect(editor.getCss()).toBe(styleStr); }); });