diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index b2aade466..9cf357aad 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -271,7 +271,7 @@ var padeditbar = (function() var module = $("#" + thisModuleName); //skip any "force reconnect" message - var isAForceReconnectMessage = module.find('#forcereconnect').is(':visible'); + var isAForceReconnectMessage = module.find('button#forcereconnect:visible').length > 0; if(isAForceReconnectMessage) continue; diff --git a/tests/frontend/specs/pad_modal.js b/tests/frontend/specs/pad_modal.js index 15eb8ac86..80752e4b8 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 = $(''); - $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);