Phuedx has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324692

Change subject: Hygiene: Don't fall through unless necessary
......................................................................

Hygiene: Don't fall through unless necessary

The preview reducer would treat the LINK_ABANDON_END and
PREVIEW_ABANDON_END actions as the PREVIEW_DWELL action. Fortunately,
this was a NOOP as they would only fall through if the preview was being
dwelled upon.

HT Joaquin Hernandez.

Change-Id: I01ff47de34ac41f1e6aa46aa5baccc2a27013f1b
---
M resources/ext.popups/reducers.js
M tests/qunit/ext.popups/reducers.test.js
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/92/324692/1

diff --git a/resources/ext.popups/reducers.js b/resources/ext.popups/reducers.js
index fb2ce3a..cee40f7 100644
--- a/resources/ext.popups/reducers.js
+++ b/resources/ext.popups/reducers.js
@@ -96,7 +96,8 @@
                                        } );
                                }
 
-                               /* falls through */
+                               return state;
+
                        case mw.popups.actionTypes.PREVIEW_DWELL:
                                return nextState( state, {
                                        isUserDwelling: true
diff --git a/tests/qunit/ext.popups/reducers.test.js 
b/tests/qunit/ext.popups/reducers.test.js
index 16d15dc..2d25a7e 100644
--- a/tests/qunit/ext.popups/reducers.test.js
+++ b/tests/qunit/ext.popups/reducers.test.js
@@ -107,9 +107,8 @@
                        isUserDwelling: true
                };
 
-               assert.deepEqual(
-                       mw.popups.reducers.preview( state, action ),
-                       state,
+               assert.ok(
+                       mw.popups.reducers.preview( state, action ) === state,
                        'It should NOOP if the user is dwelling on the preview.'
                );
        } );

-- 
To view, visit https://gerrit.wikimedia.org/r/324692
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I01ff47de34ac41f1e6aa46aa5baccc2a27013f1b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: mpga
Gerrit-Owner: Phuedx <samsm...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to