summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLuiza Pagliari <lpagliari@gmail.com>2017-05-12 07:03:40 -0300
committerLuiza Pagliari <lpagliari@gmail.com>2017-05-12 07:03:40 -0300
commit894ebffcaf3d5fcab957f5e40d1fc94359003d54 (patch)
tree10bd2d5a66ddb0f0fe31a6d400616ef50074f220 /tests
parent9176bf9bad8d30828ec7cf215357d5a054842c57 (diff)
downloadetherpad-lite-894ebffcaf3d5fcab957f5e40d1fc94359003d54.zip
[fix] Do not close ANY "force reconnect" message
Fix previous commit. As "force reconnect" buttons have all the same id on DOM, on the previous commit we were only disallowing the first button with that id on DOM -- "userdup" -- to be closed by a click on editor. Casually the tests were using the same error to simulate a "force reconnect", so even the tests were not getting the issue.
Diffstat (limited to 'tests')
-rw-r--r--tests/frontend/specs/pad_modal.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/frontend/specs/pad_modal.js b/tests/frontend/specs/pad_modal.js
index 15eb8ac8..80752e4b 100644
--- a/tests/frontend/specs/pad_modal.js
+++ b/tests/frontend/specs/pad_modal.js
@@ -1,15 +1,11 @@
describe('Pad modal', function() {
context('when modal is a "force reconnect" message', function() {
- var MODAL_SELECTOR = '#connectivity .userdup';
-
- var padId, $originalPadFrame;
+ var MODAL_SELECTOR = '#connectivity .slowcommit';
beforeEach(function(done) {
- padId = helper.newPad(function() {
- // open same pad on another iframe, to force userdup error
- var $otherIframeWithSamePad = $('<iframe src="/p/' + padId + '" style="height: 1px;"></iframe>');
- $originalPadFrame = $('#iframe-container iframe');
- $otherIframeWithSamePad.insertAfter($originalPadFrame);
+ helper.newPad(function() {
+ // force a "slowcommit" error
+ helper.padChrome$.window.pad.handleChannelStateChange('DISCONNECTED', 'slowcommit');
// wait for modal to be displayed
var $modal = helper.padChrome$(MODAL_SELECTOR);