diff --git a/packages/core/test/percy.test.js b/packages/core/test/percy.test.js index 8f930a3d0..96000e838 100644 --- a/packages/core/test/percy.test.js +++ b/packages/core/test/percy.test.js @@ -90,7 +90,7 @@ describe('Percy', () => { }); // expect required arguments are passed to PercyDOM.serialize - expect(evalSpy.calls.allArgs()[3]).toEqual(jasmine.arrayContaining([jasmine.anything(), { enableJavaScript: undefined, disableShadowDOM: true, domTransformation: undefined }])); + expect(evalSpy.calls.allArgs()[3]).toEqual(jasmine.arrayContaining([jasmine.anything(), { enableJavaScript: undefined, disableShadowDOM: true, domTransformation: undefined, reshuffleInvalidTags: undefined }])); expect(snapshot.url).toEqual('http://localhost:8000/'); expect(snapshot.domSnapshot).toEqual(jasmine.objectContaining({ diff --git a/packages/core/test/snapshot.test.js b/packages/core/test/snapshot.test.js index 283b9bcca..772fb4564 100644 --- a/packages/core/test/snapshot.test.js +++ b/packages/core/test/snapshot.test.js @@ -659,7 +659,8 @@ describe('Snapshot', () => { domSnapshot: { html: ``, warnings: ['Test serialize warning'], - resources: [resource, textResource] + resources: [resource, textResource], + hints: ['DOM elements found outside '] } }); @@ -1301,5 +1302,26 @@ describe('Snapshot', () => { expect(root.id).toEqual(sha256hash(injectedDOM)); expect(root.attributes).toHaveProperty('base64-content', base64encode(injectedDOM)); }); + + it('warns when domSnapshot hints of invalid tags', async () => { + await percy.snapshot({ + name: 'Serialized Snapshot', + url: 'http://localhost:8000', + domSnapshot: { + html: '', + warnings: [], + resources: [], + hints: ['DOM elements found outside '] + } + + }); + + expect(logger.stderr).toEqual([ + '[percy] DOM elements found outside , percyCSS might not work' + ]); + expect(logger.stdout).toEqual([ + '[percy] Snapshot taken: Serialized Snapshot' + ]); + }); }); });