Skip to content

Commit 5ace066

Browse files
committed
update delete message test
1 parent 53e881d commit 5ace066

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

ui-tests/tests/message-toolbar.spec.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,27 @@ test.describe('#messageToolbar', () => {
129129
).not.toContain('(edited)');
130130
});
131131

132-
test('should set the message as deleted', async ({ page }) => {
132+
test('should not render deleted message', async ({ page }) => {
133133
const chatPanel = await openChat(page, FILENAME);
134-
const message = chatPanel
135-
.locator('.jp-chat-messages-container .jp-chat-message')
136-
.first();
134+
const messagesContainer = chatPanel.locator('.jp-chat-messages-container');
135+
136+
const messageCountBefore = await messagesContainer
137+
.locator('.jp-chat-message')
138+
.count();
139+
expect(messageCountBefore).toBe(1);
140+
141+
const message = messagesContainer.locator('.jp-chat-message').first();
137142
const messageContent = message.locator('.jp-chat-rendered-markdown');
138143

139144
// Should display the message toolbar
140145
await messageContent.hover({ position: { x: 5, y: 5 } });
141146
await messageContent.locator('.jp-chat-toolbar jp-button').last().click();
142147

143-
await expect(messageContent).not.toBeVisible();
144-
expect(
145-
await message.locator('.jp-chat-message-header').textContent()
146-
).toContain('(message deleted)');
148+
await expect(message).not.toBeVisible();
149+
150+
const messageCountAfter = await messagesContainer
151+
.locator('.jp-chat-message')
152+
.count();
153+
expect(messageCountAfter).toBe(0);
147154
});
148155
});

0 commit comments

Comments
 (0)