From 6cd42629e1b8963284f046cac066d2f336586542 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 21 Mar 2019 18:04:19 +0800 Subject: [PATCH] Fix failing qunit test. --- test/javascripts/helpers/create-pretender.js.es6 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/javascripts/helpers/create-pretender.js.es6 b/test/javascripts/helpers/create-pretender.js.es6 index abc6ed548b3..08f530d839a 100644 --- a/test/javascripts/helpers/create-pretender.js.es6 +++ b/test/javascripts/helpers/create-pretender.js.es6 @@ -461,6 +461,16 @@ export default function() { email: "discobot_email" } ]; + + const showEmails = request.queryParams.show_emails; + + if (showEmails === "false") { + store = store.map(item => { + delete item.email; + return item; + }); + } + const ascending = request.queryParams.ascending; const order = request.queryParams.order; @@ -469,6 +479,7 @@ export default function() { return a[order] - b[order]; }); } + if (ascending) { store = store.reverse(); }