[MM-31547] Stop users from being able to enter the same server name or URL twice (#2049)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
Devin Binnie
2022-04-19 09:31:04 -04:00
committed by GitHub
parent a26e3caf23
commit ce2ddb6a6a
6 changed files with 72 additions and 8 deletions

View File

@@ -109,6 +109,18 @@ describe('EditServerModal', function desc() {
existing.should.be.true;
});
it('should not edit team if another server with the same name or URL exists', async () => {
await editServerView.fill('#teamNameInput', config.teams[1].name);
await editServerView.click('#saveNewServerModal');
let existing = await editServerView.isVisible('#teamNameInput.is-invalid');
existing.should.be.true;
await editServerView.fill('#teamNameInput', 'NewTestTeam');
await editServerView.fill('#teamUrlInput', config.teams[1].url);
existing = await editServerView.isVisible('#teamUrlInput.is-invalid');
existing.should.be.true;
});
it('MM-T4391_2 should edit team when Save is pressed and name edited', async () => {
await editServerView.fill('#teamNameInput', 'NewTestTeam');
await editServerView.click('#saveNewServerModal');