test(app): distinguish timeline errors from submission failures

A rejected prompt displays its reason in both the submission status and the timeline. Scope the timeline assertions to the notification row.
This commit is contained in:
paseo-bot[bot]
2026-10-13 13:05:09 +02:00
parent 9e596e3377
commit 6d7aaf5461
3 changed files with 9 additions and 4 deletions
@@ -305,7 +305,7 @@ async function retryRestoredSubmission(page: Page, prompt: string): Promise<void
async function expectRejectedPromptBeforeError(page: Page, prompt: string, errorMessage: string) {
const messages = page
.getByTestId("user-message")
.or(page.getByText(errorMessage, { exact: true }));
.or(page.getByTestId("timeline-notification").filter({ hasText: errorMessage }));
await expect(messages).toHaveCount(2);
await expect(messages.nth(0)).toContainText(prompt);
await expect(messages.nth(1)).toHaveText(errorMessage);
+7 -2
View File
@@ -186,7 +186,8 @@ export async function createCreationScenario(page: Page) {
await requests.settled();
await expect(
page
.getByText("Requested mock prompt rejection", { exact: true })
.getByTestId("timeline-notification")
.filter({ hasText: "Requested mock prompt rejection" })
.filter({ visible: true }),
).toBeVisible();
await expect(
@@ -203,7 +204,11 @@ export async function createCreationScenario(page: Page) {
async expectPromptBeforeError(prompt: string) {
const messages = page
.getByTestId("user-message")
.or(page.getByText("Requested mock prompt rejection", { exact: true }))
.or(
page
.getByTestId("timeline-notification")
.filter({ hasText: "Requested mock prompt rejection" }),
)
.filter({ visible: true });
await expect(messages).toHaveCount(2);
await expect(messages.nth(0)).toContainText(prompt);
+1 -1
View File
@@ -2161,7 +2161,7 @@ export const Notification = memo(function Notification({
[resolvedDisableOuterSpacing, config.bg],
);
return (
<View style={containerStyle}>
<View style={containerStyle} testID="timeline-notification">
<View style={notificationStylesheet.content}>
<View style={notificationStylesheet.row}>
<View style={notificationStylesheet.iconContainer}>