[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.
This commit is contained in:
parent
9176bf9bad
commit
894ebffcaf
|
@ -271,7 +271,7 @@ var padeditbar = (function()
|
||||||
var module = $("#" + thisModuleName);
|
var module = $("#" + thisModuleName);
|
||||||
|
|
||||||
//skip any "force reconnect" message
|
//skip any "force reconnect" message
|
||||||
var isAForceReconnectMessage = module.find('#forcereconnect').is(':visible');
|
var isAForceReconnectMessage = module.find('button#forcereconnect:visible').length > 0;
|
||||||
if(isAForceReconnectMessage)
|
if(isAForceReconnectMessage)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
describe('Pad modal', function() {
|
describe('Pad modal', function() {
|
||||||
context('when modal is a "force reconnect" message', function() {
|
context('when modal is a "force reconnect" message', function() {
|
||||||
var MODAL_SELECTOR = '#connectivity .userdup';
|
var MODAL_SELECTOR = '#connectivity .slowcommit';
|
||||||
|
|
||||||
var padId, $originalPadFrame;
|
|
||||||
|
|
||||||
beforeEach(function(done) {
|
beforeEach(function(done) {
|
||||||
padId = helper.newPad(function() {
|
helper.newPad(function() {
|
||||||
// open same pad on another iframe, to force userdup error
|
// force a "slowcommit" error
|
||||||
var $otherIframeWithSamePad = $('<iframe src="/p/' + padId + '" style="height: 1px;"></iframe>');
|
helper.padChrome$.window.pad.handleChannelStateChange('DISCONNECTED', 'slowcommit');
|
||||||
$originalPadFrame = $('#iframe-container iframe');
|
|
||||||
$otherIframeWithSamePad.insertAfter($originalPadFrame);
|
|
||||||
|
|
||||||
// wait for modal to be displayed
|
// wait for modal to be displayed
|
||||||
var $modal = helper.padChrome$(MODAL_SELECTOR);
|
var $modal = helper.padChrome$(MODAL_SELECTOR);
|
||||||
|
|
Loading…
Reference in New Issue