Skip to content

Commit 483277c

Browse files
committed
ui-test on time visibility
1 parent 5ce2b92 commit 483277c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ui-tests/tests/ui-config.spec.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@ test.describe('#stackedMessages', () => {
105105
const messages = messagesContainer.locator('.jp-chat-message');
106106
await expect(messages).toHaveCount(2);
107107

108-
// Hide the time to avoid time zone diff
109-
await messages
110-
.locator('.jp-chat-message-time')
108+
// Expect the time to be visible only in the first message.
109+
const times = messages.locator('.jp-chat-message-time');
110+
await expect(times).toHaveCount(1);
111+
await expect(times.first()).toBeVisible();
112+
113+
// Hide the time to avoid time zone diff in screenshot.
114+
await times
111115
.evaluateAll(elements =>
112116
elements.map(element => (element.style.display = 'none'))
113117
);
@@ -147,6 +151,11 @@ test.describe('#stackedMessages', () => {
147151
const messages = messagesContainer.locator('.jp-chat-message');
148152
await expect(messages).toHaveCount(2);
149153

154+
// Expect the time to be visible only in the first message.
155+
const times = messages.locator('.jp-chat-message-time');
156+
await expect(times).toHaveCount(2);
157+
await expect(times.last()).toBeVisible();
158+
150159
// Hide the time to avoid time zone diff
151160
await messages
152161
.locator('.jp-chat-message-time')

0 commit comments

Comments
 (0)