test(e2e): delete screenshot-only browser specs (bookshelf-bz643.1) #1324
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bd-bookshelf-bz643.1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
journey_oi1l2_screenshot_test.go,journey_library_counts_sidebar_test.go,journey_cover_card_series_test.goItsteps from existing journeys:journey_workflow_detail_test.goandjourney_reset_progress_test.goe2e/api/journey_11_reader_html_structure_test.gofor the cover-card series-name label (previously only verified via browser DOM walk)Spec delta: 318 → 313
Itspecs, 78 → 75 top-levelDescribes ine2e/browser/Skipped (carry real behavioral DOM assertions, NOT screenshot-only):
journey_refresh_cover_test.go— kebab click +is-openclass + button presence checkjourney_email_settings_test.goscreenshot Its — both assert.modal-formclass before screenshotjourney_detach_file_test.goscreenshot It — asserts.modal-header+.modal-footerpresenceTest plan
make build— compiles cleango build -tags e2e ./e2e/...— all e2e packages compilemake test— all unit tests passmake coverage— 100% coverage preserved, gate passesmake e2e-policy-check— all Describes are Ordered journey containersCloses bead bookshelf-bz643.1 on merge.
9a9924964e0d03cd7eb70d03cd7eb7af40cf5b8bSecurity Review — PR #1324 (bookshelf-bz643.1)
Scope: deletion of 3 browser e2e specs (screenshot-only) + removal of screenshot-only
Itblocks in 2 existing specs + one replacementItin the API journey suite.Deleted files examined
e2e/browser/journey_cover_card_series_test.go— Seeds two books, navigates to/books?library_id=..., asserts DOM text via go-rod, then callsuploadJourneyScreenshotToPR. No authz / CSP / cross-user / scoping assertion. Pure DOM-text + screenshot spec.e2e/browser/journey_library_counts_sidebar_test.go— Seeds two libraries, navigates to/,Eventually-waits for a sidebar element to appear, then posts a screenshot. No behavioural assertion beyond DOM presence. No authz / ownership / CSP assertion.e2e/browser/journey_oi1l2_screenshot_test.go— Navigates to/accountand/account/hardcover, captures PNGs, posts them to the PR. Zero behaviouralExpectcalls on security-sensitive properties. Pure screenshot capture.Removed
Itblocks in surviving specsjourney_reset_progress_test.go: deleted aposts screenshot of post-reset book detail page to PRstep. Only assertion was the vacuousscreenshotURL == "" || screenshotURL != ""(always true). No authz guard removed.journey_workflow_detail_test.go: deletedcaptures and posts a screenshot of the older-execution detail page. No assertion on auth, RBAC, or CSP.Added spec
journey_11_reader_html_structure_test.go:232— adds anItthat callshtmlBody("/books")(the suite's authenticated client, user-1, library already mapped viaseedBook'suser_library_mappinginsert) and assertscover-card-series+E2E Seriesappear in the HTML body. The added spec:authClient— no new unauthenticated surface.seedBookwhich already scopes the library to user-id=1 viauser_library_mapping; the fail-closed access control path is exercised.Verdict
No security control has been removed. The three deleted files contain zero authz, ownership, scoping, or CSP assertions — they are purely screenshot-upload utilities. The replacement API assertion reuses the suite's authenticated client and the existing library-scoped seed; it introduces no weaker surface.
REVIEW VERDICT: 0 blocker, 0 major, 0 minor
Code Review — bookshelf-bz643.1 (PR #1324)
Phase 1: Spec Compliance
The bead claims all deleted specs are "screenshot-only, zero DOM behavioral assertions." Two of the three claims are accurate; one is not.
[MAJOR] e2e/browser/journey_library_counts_sidebar_test.go:51 — deleted It contains a real DOM assertion, not replaced
The file's own comment says "screenshot-only" but the single
Itblock at line 51 contains a genuine Gomega assertion on DOM presence before taking the screenshot:This asserts that the
#sidebar-section-libraries-bodyelement is rendered by the server and present in the live DOM — a real structural check that the sidebar section exists and the server returns the expected HTML shape. Nothing in the addedjourney_11replacement covers this. A regression in the sidebar template that removesid="sidebar-section-libraries-body"would now go undetected.Suggested fix: add an
Ittoe2e/api/journey_11_reader_html_structure_test.gothat callshtmlBody("/")and assertsContainSubstring("sidebar-section-libraries-body")(the element ID is a structural invariant that the server-rendered HTML can prove without Chromium).[MAJOR] e2e/browser/journey_cover_card_series_test.go:104 — negative assertion (no series div for books without a series) deleted with no replacement
The deleted spec asserted two complementary behaviors at lines 104–110:
.cover-card-seriescontaining the series text..cover-card-seriesat all (hasSeriesmust befalse).The replacement
Itinjourney_11_reader_html_structure_test.go:240only covers assertion 1 (positive: "E2E Series" appears somewhere on/books). Assertion 2 — the absence of.cover-card-serieswhenseries_nameis NULL — is gone. A template regression that unconditionally renders an empty.cover-card-seriesdiv for every book would pass the replacement assertion.ContainSubstringon the whole page body cannot prove absence; a false-positive is possible if any other book in the journey-11 seed also happens to have a series name seeded by anotherIt's side-effects.Suggested fix: seed a second book with no
series_nameinBeforeAll, then add a separateIttojourney_11that fetches/booksand assertsContainSubstring("cover-card-series")appears exactly once (or that a specific no-series title's HTML block does not containcover-card-series). Alternatively, assert the count ofcover-card-seriesoccurrences equals the number of seeded books that have a series.Phase 2: Code Quality
journey_reset_progress_test.go — removed It: the removed screenshot
Itat line 144 contained only a tautologicalExpect(screenshotURL == "" || screenshotURL != "").To(BeTrue()). This is always true. No behavioral coverage lost. TheuploadResetProgressScreenshotToPRhelper removal is clean; no callers remain. The"os"import removal matches. Safe deletion.journey_workflow_detail_test.go — removed It: the removed
It("captures and posts a screenshot …")at line 206 had noExpectassertions at all (just navigate + screenshot + log). TheuploadWorkflowDetailScreenshotToPRhelper removal is clean;"os"import removal matches. Safe deletion. All real behavioralItblocks ("completed" state, no Cancel button, no status-poll controller, "running" state) remain intact.journey_oi1l2_screenshot_test.go — deleted file: the single
ItcontainedExpect(err).NotTo(HaveOccurred())onpage.Screenshot(...)errors andExpect(accountPNG).NotTo(BeEmpty())+Expect(hardcoverPNG).NotTo(BeEmpty()). These assert screenshot byte-buffer non-emptiness, not DOM content. Thepage.MustElement(".account-links-list")is a panic-on-missing guard, not a Gomega assertion. Screenshot-only classification is accurate. No behavioral coverage lost.journey_11 new It — multi-Expect: two
Expectcalls in oneIt. Permitted by the e2e multi-Expect relaxation documented inCLAUDE.md. Not a violation.htmlBody helper: does not assert HTTP 200 before reading the body. A redirect to a login page would silently return the login HTML and
ContainSubstring("cover-card-series")would pass vacuously. This is a pre-existing weakness of the journey-11 helper pattern (not introduced by this PR), but worth noting for the two new assertions that depend onauthClientbeing properly authenticated.e2e-policy-check compliance: all remaining
Describeblocks in modified files areOrderedjourneys. The three deleted files each contained oneOrderedDescribe; their removal shrinks the suite count but does not violate the policy (no non-OrderedDescribeis introduced).REVIEW VERDICT: 0 blocker, 2 major, 0 minor
af40cf5b8b157dc9a0ffRe-review: bead bookshelf-bz643.1 — verifying 2 prior MAJORs closed
Scope: verify only the two MAJOR findings from the prior review. Both addressed in
e2e/api/journey_11_reader_html_structure_test.go.MAJOR 1 (sidebar-section) — CLOSED
e2e/api/journey_11_reader_html_structure_test.go:263The new
Itblock fetcheshtmlBody("/")and assertsContainSubstring("sidebar-section-libraries-body"). This directly replaces the browser spec assertion that the element exists in the rendered page. The assertion is inside the Ordered journey container and exercises the real app stack. Finding is closed.MAJOR 2 (negative cover-card-series) — CLOSED
e2e/api/journey_11_reader_html_structure_test.go:294The fix seeds two books:
bookIDviaseedBook()(confirmed to insertseries_name='E2E Series') andnoSeriesBookIDvia a direct INSERT with onlytitleand noseries_name. The negative It asserts:With 2 books in the response (1 with series, 1 without), a count of exactly 1 proves absence on the no-series book. An unconditional
.cover-card-seriesrendered on every card would produce count=2 and fail the assertion. TheseedBookimplementation (confirmed viae2e/api/helpers_test.go) does insertseries_name="E2E Series", making the count assumption correct. The positive It separately asserts the series name text appears. Finding is closed.Both new Its are inside the existing
Orderedjourney container — no policy regressions.REVIEW VERDICT: 0 blocker, 0 major, 0 minor
157dc9a0ff8a540d850dCode Review — bookshelf-bz643.1 (PR #1324) — Final Pass
A prior two-round review already closed 2 MAJORs (sidebar element presence, negative cover-card-series). This pass independently re-verifies those fixes and audits the full diff fresh.
Phase 1: Spec Compliance
Bead claims: delete 3 browser spec files (screenshot-only / low-value), remove 2 screenshot-only It blocks, replace real assertions with equivalent API-tier Its in journey_11.
All claims verified accurate.
Phase 2: Coverage Parity
journey_oi1l2_screenshot_test.go — The sole It captures two screenshots via
page.Screenshot(), then assertsExpect(accountPNG).NotTo(BeEmpty())andExpect(hardcoverPNG).NotTo(BeEmpty()). These only provego-rodreturned bytes — they are not DOM or server-render assertions. Deletion loses no real coverage.journey_reset_progress_test.go (deleted It) — The removed It (
posts screenshot of post-reset book detail page to PR) contains a single assertion:Expect(screenshotURL == "" || screenshotURL != "").To(BeTrue())— a Boolean tautology, always true. No behavioral coverage lost.journey_workflow_detail_test.go (deleted It) — The removed It (
captures and posts a screenshot of the older-execution detail page) contains zero Expect calls; onlyGinkgoWriter.Printf. No behavioral coverage lost.journey_library_counts_sidebar_test.go — The prior review correctly identified a real DOM assertion (
Eventually(#sidebar-section-libraries-body).Should(BeTrue())). The fix addse2e/api/journey_11_reader_html_structure_test.go:273: callshtmlBody("/")and assertsContainSubstring("sidebar-section-libraries-body"). The server-rendered check is equivalent — the element is a staticid=in the HTML template, not Chromium-dependent. Coverage is maintained.journey_cover_card_series_test.go — The prior review correctly identified that the negative assertion (standalone card must NOT have
.cover-card-series) was dropped. The fix adds two Its at lines 285 and 294:htmlBody("/books")assertsContainSubstring("cover-card-series")ANDContainSubstring("E2E Series").strings.Count(body, "cover-card-series") == 1with 2 books seeded (1 with series, 1 without). Verified thatseedBook()insertsseries_name="E2E Series"andnoSeriesBookIDinserts only(book_id, title)— no series_name. The reader books (epubBookID,cbzBookID,pdfBookID) also useINSERT INTO book_metadata (book_id, title) VALUES (?, ?)with no series_name. Count of 1 is sound.One minor observation:
noSeriesBookIDis inserted into the same library asbookID(viaSELECT library_id FROM book WHERE id = ?), which is already user_library_mapping-scoped to user_id=1 byseedBook. The new book inherits access correctly — no user-scoping gap.Phase 2: Code Quality
No new production code in this diff — only e2e test additions and browser spec deletions. No handler, service, workflow, or SQL changes.
The added
BeforeAllblock is consistent with the existingOrderedjourney pattern. Thestringsimport is added correctly. No linter exclusions added. No white-box test patterns introduced (file declarespackage browser_test/package api_test).PR Status
8a540d850d82)REVIEW VERDICT: 0 blocker, 0 major, 0 minor
8a540d850d759190fab8