From 53e807b052d9edeeda7ad6299a7dde263dc55bcc Mon Sep 17 00:00:00 2001 From: Sean Doyle Date: Fri, 12 Apr 2024 11:05:40 -0400 Subject: [PATCH] Fix failing test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to [#34][] As mentioned in a [comment on #34][], the test suite wasn't executed when the code was initially contributed. When opening `test/index.html` locally in a browser, there is a single test failure: ``` does not ignore body when ignoreActiveValue is true and no element has focus ‣ AssertionError: expected …(28) to equal @[native code] ``` This commit resolves that failure by changing the test to more accurately exercise the desired behavior. [#34]: https://github.com/bigskysoftware/idiomorph/pull/34 [comment on #34]: https://github.com/bigskysoftware/idiomorph/pull/34#discussion_r1466591489 --- test/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core.js b/test/core.js index a2d0517..b36a5ec 100644 --- a/test/core.js +++ b/test/core.js @@ -253,7 +253,7 @@ describe("Core morphing tests", function(){ Idiomorph.morph(initial, finalSrc, {morphStyle:'outerHTML'}); initial.outerHTML.should.equal(''); - document.activeElement.should.equal(initial); + document.activeElement.should.equal(document.body); let finalSrc2 = ''; Idiomorph.morph(initial, finalSrc2, {morphStyle:'outerHTML', ignoreActiveValue: true});