From 74032a18046bf45ab2ed90e0ea7dafbe120560a5 Mon Sep 17 00:00:00 2001 From: Mike Fotinakis Date: Tue, 21 Mar 2017 12:11:28 -0700 Subject: [PATCH] Fix passthrough of enableJavascript option. (#24) * Fix pass through of enableJavascript option. * Fix tests. * Fix variable name. --- addon/snapshot.js | 1 + index.js | 1 + tests/acceptance/dummy-test.js | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/addon/snapshot.js b/addon/snapshot.js index 45ab4773..e7860bf7 100644 --- a/addon/snapshot.js +++ b/addon/snapshot.js @@ -61,6 +61,7 @@ export function percySnapshot(name, options) { content: getDoctype() + domCopy[0].outerHTML, widths: options.widths, breakpoints: options.breakpoints, + enableJavaScript: options.enableJavaScript, }), statusCode: { 400: function(jqXHR) { diff --git a/index.js b/index.js index 8371caf5..1eabc219 100644 --- a/index.js +++ b/index.js @@ -313,6 +313,7 @@ module.exports = { { name: data.name, widths: widths, + enableJavaScript: data.enableJavaScript, } ); diff --git a/tests/acceptance/dummy-test.js b/tests/acceptance/dummy-test.js index a792a54e..a2b46946 100644 --- a/tests/acceptance/dummy-test.js +++ b/tests/acceptance/dummy-test.js @@ -35,3 +35,11 @@ test('name is autogenerated if given a Mocha test object', function(assert) { }; percySnapshot(mochaTestDouble); }); + +test('enableJavaScript option can pass through', function(assert) { + visit('/'); + andThen(function() { + assert.equal(currentURL(), '/'); + }); + percySnapshot(assert, {enableJavaScript: true}); +});