[MM-14093] Rename 'team' to 'server' and 'tab' to 'view' in most cases, some additional cleanup (#2711)

* Rename MattermostTeam -> UniqueServer, MattermostTab -> UniqueView

* Rename 'team' to 'server'

* Some further cleanup

* Rename weirdly named function

* Rename 'tab' to 'view' in most instances

* Fix i18n

* PR feedback
This commit is contained in:
Devin Binnie
2023-05-08 09:17:01 -04:00
committed by GitHub
parent 9f75ddcf0f
commit 316beba950
110 changed files with 1698 additions and 1757 deletions

View File

@@ -32,9 +32,9 @@ describe('menu_bar/dropdown', function desc() {
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
const dropdownView = this.app.windows().find((window) => window.url().includes('dropdown'));
await mainWindow.click('.TeamDropdownButton');
const firstMenuItem = await dropdownView.innerText('.TeamDropdown button.TeamDropdown__button:nth-child(1) span');
const secondMenuItem = await dropdownView.innerText('.TeamDropdown button.TeamDropdown__button:nth-child(2) span');
await mainWindow.click('.ServerDropdownButton');
const firstMenuItem = await dropdownView.innerText('.ServerDropdown button.ServerDropdown__button:nth-child(1) span');
const secondMenuItem = await dropdownView.innerText('.ServerDropdown button.ServerDropdown__button:nth-child(2) span');
firstMenuItem.should.equal(config.teams[0].name);
secondMenuItem.should.equal(config.teams[1].name);
@@ -57,7 +57,7 @@ describe('menu_bar/dropdown', function desc() {
let dropdownHeight = await browserWindow.evaluate((window) => window.getBrowserViews().find((view) => view.webContents.getURL().includes('dropdown')).getBounds().height);
dropdownHeight.should.equal(0);
await mainWindow.click('.TeamDropdownButton');
await mainWindow.click('.ServerDropdownButton');
dropdownHeight = await browserWindow.evaluate((window) => window.getBrowserViews().find((view) => view.webContents.getURL().includes('dropdown')).getBounds().height);
dropdownHeight.should.be.greaterThan(0);
});
@@ -74,8 +74,8 @@ describe('menu_bar/dropdown', function desc() {
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
const dropdownView = this.app.windows().find((window) => window.url().includes('dropdown'));
await mainWindow.click('.TeamDropdownButton');
await dropdownView.click('.TeamDropdown__button.addServer');
await mainWindow.click('.ServerDropdownButton');
await dropdownView.click('.ServerDropdown__button.addServer');
const newServerModal = await this.app.waitForEvent('window', {
predicate: (window) => window.url().includes('newServer'),
@@ -107,8 +107,8 @@ describe('menu_bar/dropdown', function desc() {
});
it('MM-T4408_2 should show the second view after clicking the menu item', async () => {
await mainWindow.click('.TeamDropdownButton');
await dropdownView.click('.TeamDropdown button.TeamDropdown__button:nth-child(2)');
await mainWindow.click('.ServerDropdownButton');
await dropdownView.click('.ServerDropdown button.ServerDropdown__button:nth-child(2)');
const firstViewIsAttached = await browserWindow.evaluate((window, url) => Boolean(window.getBrowserViews().find((view) => view.webContents.getURL() === url)), env.exampleURL);
firstViewIsAttached.should.be.false;

View File

@@ -72,23 +72,23 @@ describe('Menu/window_menu', function desc() {
after(afterFunc);
it('MM-T826_1 should show the second server', async () => {
let dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton');
let dropdownButtonText = await mainWindow.innerText('.ServerDropdownButton');
dropdownButtonText.should.equal('google');
robot.keyTap('2', ['control', process.platform === 'darwin' ? 'command' : 'shift']);
dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton:has-text("github")');
dropdownButtonText = await mainWindow.innerText('.ServerDropdownButton:has-text("github")');
dropdownButtonText.should.equal('github');
});
it('MM-T826_2 should show the third server', async () => {
robot.keyTap('3', ['control', process.platform === 'darwin' ? 'command' : 'shift']);
const dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton:has-text("google")');
const dropdownButtonText = await mainWindow.innerText('.ServerDropdownButton:has-text("google")');
dropdownButtonText.should.equal('google');
});
it('MM-T826_3 should show the first server', async () => {
robot.keyTap('1', ['control', process.platform === 'darwin' ? 'command' : 'shift']);
const dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton:has-text("example")');
const dropdownButtonText = await mainWindow.innerText('.ServerDropdownButton:has-text("example")');
dropdownButtonText.should.equal('example');
});
});