MM-61525, MM-61868: Autohide channel bookmarks when empty (#29454)

Этот коммит содержится в:
Caleb Roseland
2024-12-19 09:23:29 -06:00
коммит произвёл GitHub
родитель cf392f7cca
Коммит 09add85a51
10 изменённых файлов: 474 добавлений и 222 удалений

46
e2e-tests/cypress/package-lock.json сгенерированный
Просмотреть файл

@@ -11,8 +11,8 @@
"@babel/eslint-parser": "7.24.1",
"@babel/eslint-plugin": "7.23.5",
"@cypress/request": "3.0.1",
"@mattermost/client": "9.6.0",
"@mattermost/types": "9.6.0",
"@mattermost/client": "10.2.0",
"@mattermost/types": "10.2.0",
"@testing-library/cypress": "10.0.1",
"@types/async": "3.2.24",
"@types/authenticator": "1.1.4",
@@ -1723,16 +1723,16 @@
}
},
"node_modules/@mattermost/client": {
"version": "9.6.0",
"resolved": "https://registry.npmjs.org/@mattermost/client/-/client-9.6.0.tgz",
"integrity": "sha512-H1SKLKWUSqbGb7OcSWS9PdIp9eFUPaotGhrOnjradpaAv5fLPmfTzkLL5ZwRTZ9j+hiOT+D/p3vpNBqjCItiNQ==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@mattermost/client/-/client-10.2.0.tgz",
"integrity": "sha512-rtrC72Gj66+CFuVGryex1z+IvBTHAEFY//z13i/2sm/tPDuWREJ0jJcxgB0XULrInDVN1k5oibu2aeqVkhrRNA==",
"dev": true,
"dependencies": {
"form-data": "^4.0.0"
},
"peerDependencies": {
"@mattermost/types": "*",
"typescript": "^4.3"
"@mattermost/types": "^9.3.0 || ^10.0.0",
"typescript": "^4.3.0 || ^5.0.0"
},
"peerDependenciesMeta": {
"typescript": {
@@ -1741,9 +1741,9 @@
}
},
"node_modules/@mattermost/client/node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz",
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
"dev": true,
"dependencies": {
"asynckit": "^0.4.0",
@@ -1755,12 +1755,12 @@
}
},
"node_modules/@mattermost/types": {
"version": "9.6.0",
"resolved": "https://registry.npmjs.org/@mattermost/types/-/types-9.6.0.tgz",
"integrity": "sha512-x3K4M+Qu7rutb7QgjzZsJwPoCMojvcBH46vv3woeiYq7NIIg6vTg4XkDB31PktGRJRr9BtaXuLi0b0hLY6XE3A==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@mattermost/types/-/types-10.2.0.tgz",
"integrity": "sha512-Qd8rnnvn4nfJ4wObG/a2sdfy7NshqMVGnd73AzP9/ZDjE/esm8cIL89Ks3n0FJ83wdw96Omd4lFuSxAm1ftVjw==",
"dev": true,
"peerDependencies": {
"typescript": "^4.3"
"typescript": "^4.3.0 || ^5.0.0"
},
"peerDependenciesMeta": {
"typescript": {
@@ -12619,18 +12619,18 @@
}
},
"@mattermost/client": {
"version": "9.6.0",
"resolved": "https://registry.npmjs.org/@mattermost/client/-/client-9.6.0.tgz",
"integrity": "sha512-H1SKLKWUSqbGb7OcSWS9PdIp9eFUPaotGhrOnjradpaAv5fLPmfTzkLL5ZwRTZ9j+hiOT+D/p3vpNBqjCItiNQ==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@mattermost/client/-/client-10.2.0.tgz",
"integrity": "sha512-rtrC72Gj66+CFuVGryex1z+IvBTHAEFY//z13i/2sm/tPDuWREJ0jJcxgB0XULrInDVN1k5oibu2aeqVkhrRNA==",
"dev": true,
"requires": {
"form-data": "^4.0.0"
},
"dependencies": {
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz",
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
"dev": true,
"requires": {
"asynckit": "^0.4.0",
@@ -12641,9 +12641,9 @@
}
},
"@mattermost/types": {
"version": "9.6.0",
"resolved": "https://registry.npmjs.org/@mattermost/types/-/types-9.6.0.tgz",
"integrity": "sha512-x3K4M+Qu7rutb7QgjzZsJwPoCMojvcBH46vv3woeiYq7NIIg6vTg4XkDB31PktGRJRr9BtaXuLi0b0hLY6XE3A==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@mattermost/types/-/types-10.2.0.tgz",
"integrity": "sha512-Qd8rnnvn4nfJ4wObG/a2sdfy7NshqMVGnd73AzP9/ZDjE/esm8cIL89Ks3n0FJ83wdw96Omd4lFuSxAm1ftVjw==",
"dev": true,
"requires": {}
},

Просмотреть файл

@@ -6,8 +6,8 @@
"@babel/eslint-parser": "7.24.1",
"@babel/eslint-plugin": "7.23.5",
"@cypress/request": "3.0.1",
"@mattermost/client": "9.6.0",
"@mattermost/types": "9.6.0",
"@mattermost/client": "10.2.0",
"@mattermost/types": "10.2.0",
"@testing-library/cypress": "10.0.1",
"@types/async": "3.2.24",
"@types/authenticator": "1.1.4",

Просмотреть файл

@@ -25,209 +25,368 @@ describe('Channel Bookmarks', () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let user1: UserProfile;
let admin: UserProfile;
let channel: Channel;
let publicChannel: Channel;
let privateChannel: Channel;
const BOOKMARK_LIMIT = 50;
before(() => {
cy.apiRequireLicense();
cy.apiGetMe().then(({user: adminUser}) => {
admin = adminUser;
cy.apiInitSetup().then(({team, user}) => {
cy.apiInitSetup().then(({team, user, channel}) => {
testTeam = team;
user1 = user;
publicChannel = channel;
cy.visit(`/${testTeam.name}/channels/town-square`);
cy.getCurrentChannelId().then((channelId) => {
cy.makeClient().then(async (client) => {
channel = await client.getChannel(channelId);
});
cy.apiCreateChannel(testTeam.id, 'private-channel', 'private channel', 'P').then((result) => {
privateChannel = result.channel;
cy.apiAddUserToChannel(privateChannel.id, user1.id);
});
cy.visit(`/${testTeam.name}/channels/${publicChannel.name}`);
});
});
});
it('create link bookmark', () => {
// # Create link
const {link, realLink} = createLinkBookmark();
describe('functionality', () => {
it('bookmarks bar hidden when empty', () => {
// # Go to channel menu
cy.uiGetChannelInfoButton();
cy.makeClient().then(async (client) => {
const bookmarks = await client.getChannelBookmarks(publicChannel.id);
cy.wrap(bookmarks.length).should('eq', 0);
});
cy.findByTestId('channel-bookmarks-container').within(() => {
// * Verify bookmarks bar not present
cy.findByTestId('channel-bookmarks-container').should('not.exist');
});
it('create link bookmark from channel menu', () => {
// # Create link
const {link, realLink} = createLinkBookmark({fromChannelMenu: true});
// * Verify bar now visible
cy.findByTestId('channel-bookmarks-container').within(() => {
// * Verify href
cy.findByRole('link', {name: link}).should('have.attr', 'href', realLink);
cy.findByRole('link', {name: link}).should('have.attr', 'href', realLink);
});
});
});
it('create link bookmark, with emoji and custom title', () => {
const {realLink, displayName, emojiName} = createLinkBookmark({displayName: 'custom display name', emojiName: 'smiling_face_with_3_hearts'});
it('create link bookmark', () => {
// # Create link
const {link, realLink} = createLinkBookmark();
cy.findByTestId('channel-bookmarks-container').within(() => {
cy.findByTestId('channel-bookmarks-container').within(() => {
// * Verify href
cy.findByRole('link', {name: link}).should('have.attr', 'href', realLink);
});
});
it('create link bookmark, with emoji and custom title', () => {
const {realLink, displayName, emojiName} = createLinkBookmark({displayName: 'custom display name', emojiName: 'smiling_face_with_3_hearts'});
cy.findByTestId('channel-bookmarks-container').within(() => {
// * Verify emoji, displayname, and href
cy.findByRole('link', {name: `:${emojiName}: ${displayName}`}).should('have.attr', 'href', realLink);
cy.findByRole('link', {name: `:${emojiName}: ${displayName}`}).should('have.attr', 'href', realLink);
});
});
});
it('create file bookmark, and open preview', () => {
it('create file bookmark from channel menu', () => {
// # Create bookmark
const {file} = createFileBookmark({file: 'small-image.png'});
const {file} = createFileBookmark({file: 'mp4-video-file.mp4', fromChannelMenu: true});
// * Verify preview icon
cy.findByRole('link', {name: file}).as('link').find('.file-icon.image');
// # Open preview
cy.get('@link').click();
// * Verify preview opened
cy.get('.file-preview-modal').findByRole('heading', {name: file});
cy.get('.file-preview-modal__file-details-user-name').should('have.text', admin.username);
cy.get('.file-preview-modal__channel').should('have.text', `Shared in ~${channel.display_name}`);
cy.get('.icon-close').click();
});
it('create file bookmark, progress and cancel upload', () => {
const file = 'powerpointx-file.pptx';
cy.intercept(
{method: 'POST', pathname: 'files', middleware: true, times: 1},
() => {
return new Promise((resolve) =>
setTimeout(() => resolve(), 2000),
);
}).as('uploadRequest');
// * Verify uploaded
cy.findByRole('link', {name: file});
});
it('create file bookmark, and open preview', () => {
// # Create bookmark
createFileBookmark({file, save: false});
const {file} = createFileBookmark({file: 'small-image.png'});
// # Cancel upload
cy.get('a.file-preview__remove').click();
// * Verify preview icon
cy.findByRole('link', {name: file}).as('link').find('.file-icon.image');
// * Verify empty preview container
cy.get('.file-preview__container.empty');
// # Open preview
cy.get('@link').click();
// * Verify upload cancelled
cy.wait('@uploadRequest').its('state').should('eq', 'Errored');
// * Verify preview opened
cy.get('.file-preview-modal').findByRole('heading', {name: file});
cy.get('.file-preview-modal__file-details-user-name').should('have.text', admin.username);
cy.get('.file-preview-modal__channel').should('have.text', `Shared in ~${publicChannel.display_name}`);
cy.get('.icon-close').click();
});
// * Verify cannot save
cy.findByRole('button', {name: 'Add bookmark'}).should('be.disabled');
it('create file bookmark, progress and cancel upload', () => {
const file = 'powerpointx-file.pptx';
// # Try upload file again
cy.get('#bookmark-create-file-input-in-modal').attachFile(file);
cy.intercept(
{method: 'POST', pathname: 'files', middleware: true, times: 1},
() => {
return new Promise((resolve) =>
setTimeout(() => resolve(), 2000),
);
}).as('uploadRequest');
// * Verify uploaded
cy.findByTestId('titleInput').should('have.value', file);
cy.findByRole('link', {name: `file thumbnail ${file}`});
// # Create bookmark
createFileBookmark({file, save: false});
// # Save
editModalCreate();
// # Cancel upload
cy.get('a.file-preview__remove').click();
// * Verify bookmark created
cy.findByRole('link', {name: file});
});
// * Verify empty preview container
cy.get('.file-preview__container.empty');
it('create file bookmark, with emoji and custom title', () => {
// * Verify upload cancelled
cy.wait('@uploadRequest').its('state').should('eq', 'Errored');
// * Verify cannot save
cy.findByRole('button', {name: 'Add bookmark'}).should('be.disabled');
// # Try upload file again
cy.get('#bookmark-create-file-input-in-modal').attachFile(file);
// * Verify uploaded
cy.findByTestId('titleInput').should('have.value', file);
cy.findByRole('link', {name: `file thumbnail ${file}`});
// # Save
editModalCreate();
// * Verify bookmark created
cy.findByRole('link', {name: file});
});
it('create file bookmark, with emoji and custom title', () => {
// # Create bookmark
const {file, displayName, emojiName} = createFileBookmark({file: 'm4a-audio-file.m4a', displayName: 'custom displayname small-image', emojiName: 'smiling_face_with_3_hearts'});
const {file, displayName, emojiName} = createFileBookmark({file: 'm4a-audio-file.m4a', displayName: 'custom displayname small-image', emojiName: 'smiling_face_with_3_hearts'});
// * Verify emoji and custom display name
cy.findByRole('link', {name: `:${emojiName}: ${displayName}`}).click();
// * Verify emoji and custom display name
cy.findByRole('link', {name: `:${emojiName}: ${displayName}`}).click();
// * Verify preview opened
cy.get('.file-preview-modal').findByRole('heading', {name: file});
cy.get('.icon-close').click();
});
// * Verify preview opened
cy.get('.file-preview-modal').findByRole('heading', {name: file});
cy.get('.icon-close').click();
});
it('edit link bookmark', () => {
it('edit link bookmark', () => {
// # Create link
const {displayName} = createLinkBookmark();
const {displayName} = createLinkBookmark();
const nextLink = 'google.com/q=test001';
const realNextLink = `http://${nextLink}`;
const nextDisplayName = 'Next custom display name';
const nextEmojiName = 'handshake';
const nextLink = 'google.com/q=test001';
const realNextLink = `http://${nextLink}`;
const nextDisplayName = 'Next custom display name';
const nextEmojiName = 'handshake';
// # Open edit
openEditModal(displayName);
// # Open edit
openEditModal(displayName);
// # Change link, displayname, emoji
editTextInput('linkInput', nextLink);
editTextInput('titleInput', nextDisplayName);
selectEmoji(nextEmojiName);
// # Change link, displayname, emoji
editTextInput('linkInput', nextLink);
editTextInput('titleInput', nextDisplayName);
selectEmoji(nextEmojiName);
// # Save
editModalSave();
// # Save
editModalSave();
// * Verify changes
cy.findAllByRole('link', {name: `:${nextEmojiName}: ${nextDisplayName}`}).should('have.attr', 'href', realNextLink);
});
// * Verify changes
cy.findAllByRole('link', {name: `:${nextEmojiName}: ${nextDisplayName}`}).should('have.attr', 'href', realNextLink);
});
it('edit link bookmark, only display name and emoji', () => {
it('edit link bookmark, only display name and emoji', () => {
// # Create link
const {displayName, realLink} = createLinkBookmark();
const {displayName, realLink} = createLinkBookmark();
const nextDisplayName = 'Next custom display name 2';
const nextEmojiName = 'handshake';
const nextDisplayName = 'Next custom display name 2';
const nextEmojiName = 'handshake';
// # Open edit
openEditModal(displayName);
// # Open edit
openEditModal(displayName);
// # Change link, displayname, emoji
editTextInput('titleInput', nextDisplayName);
selectEmoji(nextEmojiName);
// # Change link, displayname, emoji
editTextInput('titleInput', nextDisplayName);
selectEmoji(nextEmojiName);
// # Save
editModalSave();
// # Save
editModalSave();
// * Verify changes
cy.findAllByRole('link', {name: `:${nextEmojiName}: ${nextDisplayName}`}).should('have.attr', 'href', realLink);
});
// * Verify changes
cy.findAllByRole('link', {name: `:${nextEmojiName}: ${nextDisplayName}`}).should('have.attr', 'href', realLink);
});
it('delete bookmark', () => {
const {displayName} = createLinkBookmark();
it('delete bookmark', () => {
const {displayName} = createLinkBookmark();
// * Verify bookmark exists
cy.findByRole('link', {name: displayName});
// * Verify bookmark exists
cy.findByRole('link', {name: displayName});
// # Start delete bookmark flow
openDotMenu(displayName);
cy.findByRole('menuitem', {name: 'Delete'}).click();
cy.findByRole('dialog', {name: 'Delete bookmark'}).within(() => {
// # Start delete bookmark flow
openDotMenu(displayName);
cy.findByRole('menuitem', {name: 'Delete'}).click();
cy.findByRole('dialog', {name: 'Delete bookmark'}).within(() => {
// * Verify delete dialog contents
cy.findByRole('heading', {name: 'Delete bookmark'});
cy.contains(`Are you sure you want to delete the bookmark ${displayName}?`);
cy.findByRole('heading', {name: 'Delete bookmark'});
cy.contains(`Are you sure you want to delete the bookmark ${displayName}?`);
// # Delete bookmark
cy.findByRole('button', {name: 'Yes, delete'}).click();
// # Delete bookmark
cy.findByRole('button', {name: 'Yes, delete'}).click();
});
// * Verify bookmark deleted
cy.findByRole('link', {name: displayName}).should('not.exist');
});
// * Verify bookmark deleted
cy.findByRole('link', {name: displayName}).should('not.exist');
});
it('reorder bookmark', () => {
const {displayName: name1} = createFileBookmark({file: 'm4a-audio-file.m4a', displayName: 'custom displayname 1'});
const {displayName: name2} = createFileBookmark({file: 'm4a-audio-file.m4a', displayName: 'custom displayname 2'});
it('reorder bookmark', () => {
const {displayName: name1} = createFileBookmark({file: 'm4a-audio-file.m4a', displayName: 'custom displayname 1'});
const {displayName: name2} = createFileBookmark({file: 'm4a-audio-file.m4a', displayName: 'custom displayname 2'});
// # Start reorder bookmark flow
cy.findByTestId('channel-bookmarks-container').within(() => {
cy.findAllByRole('link').should('be.visible').as('bookmarks');
cy.get('@bookmarks').eq(-1).scrollIntoView();
cy.get('@bookmarks').eq(-2).should('contain', name1);
cy.get('@bookmarks').eq(-1).should('contain', name2);
// # Start reorder bookmark flow
cy.findByTestId('channel-bookmarks-container').within(() => {
cy.findAllByRole('link').should('be.visible').as('bookmarks');
cy.get('@bookmarks').eq(-1).scrollIntoView();
cy.get('@bookmarks').eq(-2).should('contain', name1);
cy.get('@bookmarks').eq(-1).should('contain', name2);
// # Perform drag using keyboard
cy.get(`a:contains(${name1})`).
trigger('keydown', {keyCode: SpaceKeyCode}).
trigger('keydown', {keyCode: RightArrowKeyCode, force: true}).wait(TIMEOUTS.THREE_SEC).
trigger('keydown', {keyCode: SpaceKeyCode, force: true}).wait(TIMEOUTS.THREE_SEC);
// # Perform drag using keyboard
cy.get(`a:contains(${name1})`).
trigger('keydown', {keyCode: SpaceKeyCode}).
trigger('keydown', {keyCode: RightArrowKeyCode, force: true}).wait(TIMEOUTS.THREE_SEC).
trigger('keydown', {keyCode: SpaceKeyCode, force: true}).wait(TIMEOUTS.THREE_SEC);
// * Verify correct order
cy.findAllByRole('link').should('be.visible').as('bookmarks-after');
cy.get('@bookmarks-after').eq(-2).should('contain', name2);
cy.get('@bookmarks-after').eq(-1).should('contain', name1);
// * Verify correct order
cy.findAllByRole('link').should('be.visible').as('bookmarks-after');
cy.get('@bookmarks-after').eq(-2).should('contain', name2);
cy.get('@bookmarks-after').eq(-1).should('contain', name1);
});
});
});
describe('manage bookmarks - permissions enforcement', () => {
before(() => {
// # Prep: disable manage bookmarks for users - public and private channels
cy.uiResetPermissionsToDefault();
cy.findByTestId('all_users-public_channel-manage_public_channel_bookmarks-checkbox').click();
cy.findByTestId('all_users-private_channel-manage_private_channel_bookmarks-checkbox').click();
cy.uiSaveConfig();
cy.visit(`/${testTeam.name}/channels/${publicChannel.name}`);
});
after(() => {
// # Reset permissions
cy.apiAdminLogin();
cy.uiResetPermissionsToDefault();
cy.visit(`/${testTeam.name}/channels/${publicChannel.name}`);
});
it('can add bookmark: public channel, admin', () => {
// # To public channel with bookmark
createLinkBookmark({fromChannelMenu: true});
// * Verify admin can create in public channel
verifyCanCreate();
});
it('can add bookmark: private channel, admin', () => {
// # To private channel with bookmark
cy.visit(`/${testTeam.name}/channels/${privateChannel.name}`);
createLinkBookmark({fromChannelMenu: true});
// * Verify admin can create in private channel
verifyCanCreate();
});
it('cannot add bookmark: private channel, non-admin', () => {
// # Switch to non-admin user
cy.apiLogin(user1);
// # private channel
cy.visit(`/${testTeam.name}/channels/${privateChannel.name}`);
// * Verify non-admin user cannot create in private channel
verifyCannotCreate();
});
it('cannot add bookmark: public channel, non-admin', () => {
// # To public channel with bookmark
cy.visit(`/${testTeam.name}/channels/${publicChannel.name}`);
// * Verify non-admin user cannot create in public channel
verifyCannotCreate();
});
const verifyCanCreate = () => {
// * Verify can access create UI - bookmarks bar
promptAddLink();
cy.uiCloseModal('Add a bookmark');
// * Verify can access create UI - channel menu
promptAddLink(true);
cy.uiCloseModal('Add a bookmark');
};
const verifyCannotCreate = () => {
// * Verify cannot access create UI - channel menu
cy.uiOpenChannelMenu();
cy.findByRole('menuitem', {name: 'Bookmarks Bar submenu icon'}).should('not.exist');
// * Verify cannot access create UI - bookmarks bar
cy.get('#channelBookmarksPlusMenuButton').should('not.exist');
};
});
describe('limits enforced', () => {
it('max bookmarks', () => {
// # Create links, fill to max
makeBookmarks(publicChannel);
// * Verify add bookmark button is disabled
cy.findAllByRole('button', {name: 'Add a bookmark'}).should('be.disabled');
// * Verify create bookmark submenu in channel menu is not shown
cy.uiOpenChannelMenu();
cy.findByRole('menuitem', {name: 'Bookmarks Bar submenu icon'}).should('not.exist');
});
});
function makeBookmarks(channel: Channel, n?: number) {
cy.makeClient().then(async (client) => {
const nToMake = n ?? BOOKMARK_LIMIT - (await client.getChannelBookmarks(channel.id))?.length;
await Promise.allSettled(Array(nToMake).fill(0).map(() => {
return client.createChannelBookmark(publicChannel.id, {
type: 'link',
display_name: 'google.com',
link_url: `https://google.com/?q=test${getRandomId(7)}`,
}, '');
}));
});
}
});
function promptAddLink() {
cy.get('#channelBookmarksPlusMenuButton').click();
cy.get('#channelBookmarksAddLink').click();
function promptAddLink(fromChannelMenu = false) {
if (fromChannelMenu) {
cy.uiOpenChannelMenu();
cy.findByRole('menuitem', {name: 'Bookmarks Bar submenu icon'}).trigger('mouseover');
cy.findByRole('menuitem', {name: 'Add a link not selected'}).click();
} else {
cy.get('#channelBookmarksPlusMenuButton').click();
cy.get('#channelBookmarksAddLink').click();
}
}
function promptAddFile(fromChannelMenu = false) {
if (fromChannelMenu) {
cy.uiOpenChannelMenu();
cy.findByRole('menuitem', {name: 'Bookmarks Bar submenu icon'}).trigger('mouseover');
cy.findByRole('menuitem', {name: 'Attach a file not selected'}).click();
} else {
cy.get('#channelBookmarksPlusMenuButton').click();
cy.get('#channelBookmarksAttachFile').click();
}
}
function openEditModal(name: string) {
@@ -256,11 +415,12 @@ function createLinkBookmark({
displayName = '',
emojiName = '', // e.g. smile
save = true,
fromChannelMenu = false,
} = {}) {
const realLink = `http://${link}`;
// # Add link
promptAddLink();
promptAddLink(fromChannelMenu);
// # Enter link
editTextInput('linkInput', link);
@@ -290,8 +450,10 @@ function createFileBookmark({
displayName = '',
emojiName = '', // e.g. smile
save = true,
fromChannelMenu = false,
} = {}) {
cy.get('#bookmark-create-file-input').attachFile(file);
promptAddFile(fromChannelMenu);
cy.get('#root-portal #bookmark-create-file-input').attachFile(file);
if (displayName) {
// # Enter displayname