Skip to content

Commit dde2f42

Browse files
kdy1claude
andcommitted
test(desktop-testbed): check why the stepper refuses each value
The stepper test passed on any rejection, so a timeout or a fill that never found the field counted the same as the refusal it is about. It now checks each refusal's code and reason: 2.5 steps past the value and back, and 40 is outside the stepper's range. Raised by michal-e2e's review of #2358. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent fd91f64 commit dde2f42

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

‎apps/desktop-testbed/tests-swiftui/taskboard.e2e.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,17 @@ test.describe('TaskBoard (SwiftUI)', () => {
5353
await screen.getByRole('button', 'New Task').tap();
5454
const estimate = screen.getByTestId('new-estimate');
5555
await estimate.fill('3');
56-
for (const value of ['2.5', '40']) {
57-
const refused = await estimate.fill(value, { timeout: 5_000 }).then(
58-
() => false,
59-
() => true,
56+
// 2.5 steps past the value and back. 40 is outside the stepper's range: refused before any step.
57+
const refusals = [
58+
['2.5', 'goes past the value'],
59+
['40', 'outside the range'],
60+
] as const;
61+
for (const [value, reason] of refusals) {
62+
const error = await estimate.fill(value, { timeout: 5_000 }).then(
63+
() => undefined,
64+
(caught: unknown) => caught,
6065
);
61-
expect(refused, value).toBe(true);
66+
expect(error, value).toMatchObject({ code: 'ACTION_FAILED', message: expect.stringContaining(reason) });
6267
await expect(estimate).toHaveValue('3');
6368
}
6469
});

0 commit comments

Comments
 (0)