e2e-sitesmith: follow the honest Clear chat confirm label
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
96274a6aa8
commit
322742aa81
1 file changed
+3
-3
@@ -317,8 +317,8 @@ scenario('9', 'Clear chat: confirm clears the history (and stays cleared after r
|
||||
await page.waitForFunction(() => (document.querySelector('[role=dialog]')?.textContent ?? '').includes('Please remember this line'), null, { timeout: 15000 });
|
||||
await page.waitForSelector('[role=dialog] button:has-text("Clear chat")', { timeout: 10000 });
|
||||
await page.click('[role=dialog] button:has-text("Clear chat")');
|
||||
ok('first click asks for confirmation (no request yet)', (await dlg.locator('button:has-text("Confirm clear?")').count()) === 1 && srv.clearCalls.length === 0, String(srv.clearCalls.length));
|
||||
await page.click('[role=dialog] button:has-text("Confirm clear?")');
|
||||
ok('first click asks for confirmation (no request yet)', (await dlg.locator('button:has-text("Clear for everyone on this site?")').count()) === 1 && srv.clearCalls.length === 0, String(srv.clearCalls.length));
|
||||
await page.click('[role=dialog] button:has-text("Clear for everyone on this site?")');
|
||||
await page.waitForFunction(() => !(document.querySelector('[role=dialog]')?.textContent ?? '').includes('Please remember this line'), null, { timeout: 10000 }).catch(() => {});
|
||||
const txt = (await dlg.textContent()) ?? '';
|
||||
ok('confirm sends exactly one clear_history', srv.clearCalls.length === 1, String(srv.clearCalls.length));
|
||||
@@ -340,7 +340,7 @@ scenario('9b', 'Clear chat while a job is running: a plain message, nothing lost
|
||||
srv.setActiveJob({ phase: 'generating' });
|
||||
srv.setSlow(true);
|
||||
await page.click('[role=dialog] button:has-text("Clear chat")');
|
||||
await page.click('[role=dialog] button:has-text("Confirm clear?")');
|
||||
await page.click('[role=dialog] button:has-text("Clear for everyone on this site?")');
|
||||
await page.waitForSelector('[data-testid=ss-error]', { timeout: 10000 });
|
||||
const err = (await page.textContent('[data-testid=ss-error]')) ?? '';
|
||||
ok('the refusal is a readable sentence, not an error code', /still working/i.test(err) && !/job_in_progress/.test(err), err);
|
||||
|
||||
Reference in new issue
Block a user