fix(ui): объяснить неподтверждённый результат повтора сообщения

This commit is contained in:
Denozordec committed 2026-10-08 14:30:54 +07:00
1 parent e80cfeb4a9
commit b55588f29b
8 files changed
+64 -5

No files matched your search

+14
View File
@@ -29,4 +29,18 @@ test("Manual queue retry: confirmed conflict keeps form without unknown checkpoi
await retrySetup(page,r=>r.fulfill({status:409,json:{error:"Fixture queue conflict"}}));const dialog=await openRetry(page);await dialog.getByRole("button",{name:"Поставить в очередь повторно"}).click();await expect(dialog.getByRole("alert")).toHaveText("Fixture queue conflict");await expect(dialog.getByRole("checkbox")).toBeChecked();await expect(dialog.getByRole("button",{name:"Поставить в очередь повторно"})).toBeEnabled()
})
test("Manual queue retry: HTTP500 explains unknown outcome inside the dialog and preserves the guard",async({page})=>{
await page.setViewportSize({width:320,height:1000});let calls=0
await retrySetup(page,r=>{calls++;return r.fulfill({status:500,json:{error:"Внутренняя ошибка сервера"}})})
const dialog=await openRetry(page);await dialog.getByRole("button",{name:"Поставить в очередь повторно"}).click()
await expect(dialog.getByRole("alert")).toContainText("Результат повтора не подтверждён. Автоматический повтор заблокирован. Проверьте очередь и чат перед новой попыткой.")
await expect(dialog.getByRole("alert")).toContainText("Внутренняя ошибка сервера")
await expect(dialog.getByRole("checkbox")).toBeChecked();await expect(dialog.getByRole("button",{name:"Поставить в очередь повторно"})).toBeDisabled()
const bounds=await dialog.boundingBox();expect(bounds!.x).toBeGreaterThanOrEqual(0);expect(bounds!.x+bounds!.width).toBeLessThanOrEqual(320)
await dialog.screenshot({path:"test-results/alerts-outbox-http500-320.png"})
await dialog.getByRole("button",{name:"Отмена"}).click();await page.reload()
const panel=page.getByRole("region",{name:"Очередь Telegram",exact:true});await expect(panel).toContainText("Результат повтора неизвестен")
await expect(panel.getByRole("button",{name:"Повторить сообщение Held retry fixture"})).toBeDisabled();expect(calls).toBe(1)
})
test("Manual queue retry: mobile confirmation fits, cancel restores focus without POST",async({page})=>{await page.setViewportSize({width:320,height:1000});let calls=0;await retrySetup(page,r=>{calls++;return r.fulfill({json:{ok:true}})});const dialog=await openRetry(page);const bounds=await dialog.boundingBox();expect(bounds!.x).toBeGreaterThanOrEqual(0);expect(bounds!.x+bounds!.width).toBeLessThanOrEqual(320);await dialog.screenshot({path:"test-results/alerts-outbox-dialog-320.png"});await page.keyboard.press("Escape");await expect(dialog).toHaveCount(0);await expect(page.getByRole("button",{name:"Повторить сообщение Held retry fixture"})).toBeFocused();expect(calls).toBe(0)})