Skip to content

Commit adee583

Browse files
committed
expect writing indicator element to always be attached
1 parent eb0356d commit adee583

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ test.describe('#typingNotification', () => {
211211
await expect(writers).toBeAttached();
212212
const start = Date.now();
213213
await expect(writers).toHaveText(/jovyan_2 is typing/);
214-
await expect(writers).not.toBeAttached();
215214

216215
// Message should disappear after 1s, but this delay include the awareness update.
217216
expect(Date.now() - start).toBeLessThanOrEqual(2000);
@@ -243,14 +242,17 @@ test.describe('#typingNotification', () => {
243242

244243
await guestInput.press('a');
245244

246-
let visible = true;
245+
let hasContent = true;
247246
try {
248-
await page.waitForCondition(() => writers.isVisible(), 3000);
247+
await page.waitForCondition(
248+
async () => !!(await writers.textContent())?.trim(),
249+
3000
250+
);
249251
} catch {
250-
visible = false;
252+
hasContent = false;
251253
}
252254

253-
if (visible) {
255+
if (hasContent) {
254256
throw Error('The typing notification should not be attached.');
255257
}
256258
});
@@ -312,6 +314,5 @@ test.describe('#typingNotification', () => {
312314
const result = regexp.exec((await writers.textContent()) ?? '');
313315
expect(result?.[1] !== undefined);
314316
expect(result?.[1] !== result?.[2]);
315-
await expect(writers).not.toBeAttached();
316317
});
317318
});

0 commit comments

Comments
 (0)