test(e2e): replace unchecked lookups, widen the assertion timeout, restore the skipped test (#241)
Tasks 2 to 4 of the plan. Nine `collection.find(...)` dereferences become findOrFail, so a missing row fails as a named assertion naming what was wanted and how many rows were searched, rather than "Cannot read properties of undefined" pointing at test plumbing. Where the old code followed the lookup with expect(x).toBeTruthy(), that assertion is dropped: findOrFail already guarantees it, and with a better message. The expect timeout goes from Playwright's default 5s to 10s. It costs nothing on a green run — it bounds how long a failing assertion waits, not how long a passing one takes — and #239 died reporting exactly Timeout: 5000ms on a runner that also builds, migrates and runs three other suites. The admin-save happy path comes back from the #245 skip. It is the only end-to-end check that adding an item reaches the database rather than merely firing a toast, and it passed both full parallel runs and in isolation. filters.spec.ts:216 is deliberately untouched: its .find() searches CSS class names on a string array, not test data, and has no missing-row failure mode. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,23 +59,11 @@ test.describe('Admin save failures', () => {
|
||||
await expect(adminInventory.row(name)).toBeVisible();
|
||||
});
|
||||
|
||||
// SKIPPED, temporarily, to get main green while #241 is outstanding. See #245
|
||||
// before deleting this comment or the skip.
|
||||
//
|
||||
// It fails in CI and passes locally, and which test fails moves around: a
|
||||
// local parallel run of the whole suite on the same commit failed four
|
||||
// *different* specs and not this one. That is #241 — fullyParallel against a
|
||||
// single shared database — so fixing this test on its own would be guessing at
|
||||
// a symptom that will simply reappear somewhere else.
|
||||
//
|
||||
// Not the image work from #226: addItem fills a name and a price and saves,
|
||||
// attaching nothing, so the re-encoding path is never entered here.
|
||||
//
|
||||
// What this stops covering is not trivial. It is the only end-to-end check
|
||||
// that adding an item actually reaches the database rather than just firing a
|
||||
// toast — the happy path of the core admin action. Un-skip it as soon as #241
|
||||
// lands; if it still fails then, it is a real defect and worth chasing.
|
||||
test.skip('saves an item successfully when the server accepts it', async ({
|
||||
// Un-skipped now that #241 has landed (was skipped under #245). This is the
|
||||
// only end-to-end check that adding an item actually reaches the database
|
||||
// rather than just firing a toast — the happy path of the core admin action —
|
||||
// so it is worth having back.
|
||||
test('saves an item successfully when the server accepts it', async ({
|
||||
page,
|
||||
admin,
|
||||
adminInventory
|
||||
|
||||
Reference in New Issue
Block a user