[MM-39491] Force Add Server modal to stay until server has been added (#1869)

* [MM-39491] Force Add Server modal to stay until server has been added

* Make the parameter optional

* Actually do the logic, add a test for the logic

* Add remove event listener
This commit is contained in:
Devin Binnie
2021-11-25 09:47:20 -05:00
committed by GitHub
parent b4903d24c9
commit a4a275bd73
8 changed files with 122 additions and 30 deletions

View File

@@ -4,6 +4,8 @@
'use strict';
const robot = require('robotjs');
const env = require('../../modules/environment');
describe('startup/app', function desc() {
@@ -27,6 +29,17 @@ describe('startup/app', function desc() {
modalTitle.should.equal('Add Server');
});
it('MM-T4419 should not allow the user to close the new server modal when no servers exist', async () => {
const newServerModal = this.app.windows().find((window) => window.url().includes('newServer'));
const existing = await newServerModal.isVisible('#cancelNewServerModal');
existing.should.be.false;
robot.keyTap('escape');
const existingModal = this.app.windows().find((window) => window.url().includes('newServer'));
existingModal.should.not.be.null;
});
it('MM-T4399_2 should show no servers configured in dropdown when no servers exist', async () => {
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
const dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton');