From 12ab332f4d6d339ae257d550247066c34dfd06fb Mon Sep 17 00:00:00 2001 From: Robert DeLuca Date: Thu, 18 Apr 2019 14:49:14 -0500 Subject: [PATCH] fix: Revert DOM clean up methods (#160) * Revert DOM clean up methods Given this JSBin: https://jsbin.com/?html,console,output When we serialize the CSSOM into the ` + + + +
+ + diff --git a/test/integration/testcases/stabilize-dom.html b/test/integration/testcases/stabilize-dom.html index f6cf6a2c..48bf984b 100644 --- a/test/integration/testcases/stabilize-dom.html +++ b/test/integration/testcases/stabilize-dom.html @@ -15,9 +15,5 @@

- - -
Magically styled ✨
- diff --git a/test/percy-agent-client/percy-agent.test.ts b/test/percy-agent-client/percy-agent.test.ts index 9fcca8b5..9cbee56d 100644 --- a/test/percy-agent-client/percy-agent.test.ts +++ b/test/percy-agent-client/percy-agent.test.ts @@ -58,21 +58,5 @@ describe('PercyAgent', () => { expect(requestBody.widths).to.eql([320, 1024]) expect(requestBody.minHeight).to.equal(512) }) - - it('does not alter the DOM being snapshotted', () => { - const originalHTML = htmlWithoutSelector(document, '#mocha') - - subject.snapshot('a snapshot') - - const postSnapshotHTML = htmlWithoutSelector(document, '#mocha') - expect(postSnapshotHTML).to.eq(originalHTML) - expect(postSnapshotHTML).to.not.contain('data-percy') - }) - - it('multiple snapshots produce the same result', () => { - const firstDOMSnapshot = subject.snapshot('a snapshot') - const secondDOMSnapshot = subject.snapshot('a second snapshot') - expect(secondDOMSnapshot).to.eq(firstDOMSnapshot) - }) }) }) diff --git a/test/percy-agent-client/serialize-cssom.test.ts b/test/percy-agent-client/serialize-cssom.test.ts index 16750925..2cc6d519 100644 --- a/test/percy-agent-client/serialize-cssom.test.ts +++ b/test/percy-agent-client/serialize-cssom.test.ts @@ -18,14 +18,5 @@ describe('serializeCssOm', () => { const parsedDoc = (new DOMParser()).parseFromString(domSnapshot, 'text/html') expect(parsedDoc.getElementById('jsStyled')!.style.background).to.contain('red') }) - - it('cleans up after itself', () => { - subject.snapshot('test snapshot') - - const postSnapshotHTML = htmlWithoutSelector(document, '#mocha') - - expect(postSnapshotHTML).to.not.contain('data-percy-cssom-serialized') - expect(postSnapshotHTML).to.not.contain('Start of Percy serialized CSSOM') - }) }) }) diff --git a/test/percy-agent-client/serialize-input.test.ts b/test/percy-agent-client/serialize-input.test.ts index 13f4a20f..7bf47afb 100644 --- a/test/percy-agent-client/serialize-input.test.ts +++ b/test/percy-agent-client/serialize-input.test.ts @@ -32,16 +32,4 @@ describe('serializeInputElements', () => { expect(domSnapshot).to.contain('checked') }) - - it('cleans up after itself', () => { - const preSnapshotHTML = htmlWithoutSelector(document, '#mocha') - - subject.snapshot('test snapshot') - - const postSnapshotHTML = htmlWithoutSelector(document, '#mocha') - - expect(postSnapshotHTML).to.eq(preSnapshotHTML) - expect(postSnapshotHTML).to.not.contain('data-percy-input-serialized') - expect(postSnapshotHTML).to.not.contain('checked') - }) })