From d8c4dd7e77d76e98f5dbea93302f8be1eddbc8d6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 22 Mar 2020 18:39:59 +0000 Subject: [PATCH] tests: fix IE undo test --- tests/frontend/specs/undo.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/frontend/specs/undo.js b/tests/frontend/specs/undo.js index 39a19cea4..30cc88577 100644 --- a/tests/frontend/specs/undo.js +++ b/tests/frontend/specs/undo.js @@ -44,11 +44,16 @@ describe("undo button", function(){ var modifiedValue = $firstTextElement.text(); // get the modified value expect(modifiedValue).not.to.be(originalValue); // expect the value to change - /* - * ACHTUNG: this is the only place in the test codebase in which a keydown - * is sent for IE. Everywhere else IE uses keypress. - */ - var evtType = "keydown"; + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's IE + var evtType = "keypress"; + }else{ + // Edge also requires keypress. + if(window.navigator.userAgent.indexOf("Edge") > -1){ + var evtType = "keypress"; + }else{ + var evtType = "keydown"; + } + } var e = inner$.Event(evtType); e.ctrlKey = true; // Control key