From ac264001f65f97c968d10c8afd9cb825e3123ec5 Mon Sep 17 00:00:00 2001 From: joakin Date: Wed, 30 Nov 2016 19:22:54 +0100 Subject: [PATCH] Tests: Deeply extend prev state for test correctness As it is, that test is passing the same previous state and current state because extend by default only copies one level deep, resulting in the manual mutation mutating both prev and current state. This passes because the change listener always sets the link visibility from the current state regardless of the previous state (it is doing redundant work, but not too much). Change-Id: I8cf125cc4f6833fbce0fe14bdcb4ef550c7e8450 --- tests/qunit/ext.popups/footerLinkChangeListener.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qunit/ext.popups/footerLinkChangeListener.test.js b/tests/qunit/ext.popups/footerLinkChangeListener.test.js index 73b7a36a4..e09150ec5 100644 --- a/tests/qunit/ext.popups/footerLinkChangeListener.test.js +++ b/tests/qunit/ext.popups/footerLinkChangeListener.test.js @@ -63,7 +63,7 @@ // --- - prevState = $.extend( {}, this.state ); + prevState = $.extend( true, {}, this.state ); this.state.preview.enabled = true; this.footerLinkChangeListener( prevState, this.state );