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
This commit is contained in:
joakin 2016-11-30 19:22:54 +01:00
parent eb981bcd72
commit ac264001f6

View file

@ -63,7 +63,7 @@
// --- // ---
prevState = $.extend( {}, this.state ); prevState = $.extend( true, {}, this.state );
this.state.preview.enabled = true; this.state.preview.enabled = true;
this.footerLinkChangeListener( prevState, this.state ); this.footerLinkChangeListener( prevState, this.state );