From c1dc06b6c35267ff532d2fc79c0f7faaf81f4666 Mon Sep 17 00:00:00 2001 From: Dmitry Krasnoukhov Date: Mon, 21 Sep 2020 20:27:44 +0300 Subject: [PATCH] fix: Workaround for domTransformation error caused by empty document (#234) --- addon-test-support/@percy/ember/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addon-test-support/@percy/ember/index.js b/addon-test-support/@percy/ember/index.js index 574b9d58..2e3f8663 100644 --- a/addon-test-support/@percy/ember/index.js +++ b/addon-test-support/@percy/ember/index.js @@ -105,6 +105,10 @@ export default async function percySnapshot(name, options = {}) { handleAgentCommunication: false, // We only want to capture the ember application, not the testing UI domTransformation: function(clonedDom) { + if (!clonedDom.querySelector(scopedSelector)) { + return clonedDom; + } + if (options.domTransformation) { options.domTransformation(clonedDom); }