Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Clicking repeatedly on 'create' button result in multiple discusions created #33985

Merged
merged 8 commits into from
Nov 19, 2024
7 changes: 6 additions & 1 deletion apps/meteor/tests/e2e/message-actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,20 @@ test.describe.serial('message-actions', () => {

test('expect create a discussion from message', async ({ page }) => {
const message = `Message for discussion - ${Date.now()}`;
const discussionName = `Discussion Name - ${Date.now()}`;

await poHomeChannel.content.sendMessage(message);
await poHomeChannel.content.openLastMessageMenu();
await page.locator('role=menuitem[name="Start a Discussion"]').click();
const createButton = page.getByRole('dialog').getByRole('button', { name: 'create' });
// Name should be prefilled thus making the create button enabled
await expect(createButton).not.toBeDisabled();
await page.locator('role=textbox[name="Name"]').fill(discussionName);
MartinSchoeler marked this conversation as resolved.
Show resolved Hide resolved
await createButton.click();
await expect(page.locator('header h1')).toHaveText(message);
await expect(page.locator('header h1')).toHaveText(discussionName);
await poHomeChannel.sidenav.openChat(targetChannel);
// Should fail if more than one discussion has been created
await expect(page.locator('div.messages-box').getByText(discussionName)).toBeVisible();
MartinSchoeler marked this conversation as resolved.
Show resolved Hide resolved
});

test('expect star the message', async ({ page }) => {
Expand Down
Loading