Skip to content

Pin the toolbox's behavior with e2e tests before its rewrite (Notion test cases 436, 441, 442, 460, 517) - #8397

Merged
andrew-polk merged 3 commits into
masterfrom
BL-16608-toolbox-e2e
Sep 24, 2026
Merged

andrew-polk merged 3 commits into
masterfrom
BL-16608-toolbox-e2e

Conversation

@andrew-polk

@andrew-polk andrew-polk commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The toolbox infrastructure is being rewritten (BL-16608: the jQuery accordion, the hidden legacy toolbox, and the state and lifecycle code all change), but the toolbox's user-visible behavior had almost no automated coverage: no manual card even described turning tools on and off (there is one now: test case 830), and nothing automated checked that a book remembers its reader stage or level.

What the PR does

Adds characterization tests, run against the real Bloom.exe, that pass on master today, so the rewrite has to keep them passing:

  • The toolbox itself (toolbox-sections.spec.ts): turning a tool on through the real "More..." check box adds its section in order and opens it; turning it off removes it; clicking the open tool's header leaves it open; a book reopens on the tool it was left on.
  • Reader tools remembering where a book is up to (reader-tool-stage-and-level.spec.ts): each book keeps its own decodable stage and leveled level; a new book starts on the stage or level last chosen, not the one last looked at.
  • A Decodable Reader template book opens on that tool, on stage 1 (decodable-reader-template.spec.ts).
  • Pasting a marked sentence with Talking Book open does not nest its sentence markers (talking-book-paste.spec.ts, BL-10291).

New helpers cover the reader tools' stage/level stepper (readerTools.ts) and turning tools on and off (toolbox.ts). The shared makeBookFromTemplate now starts from the Collections tab, as a person does: making a second book while the Edit tab showed one with a reader tool on left the Edit tab on the template, so the test hung.

Bloom production code changes

Two data-testids, no behavior change: on the reader tools' stage/level stepper (with the numbers as data attributes, since the visible text is localized) in ReaderToolNav.tsx, and on each "More..." check box row in SettingsToolControls.tsx.

Automates Notion test case 436 (New Decodable Book Stage): https://app.notion.com/p/New-Decodable-Book-Stage-3904bb19df1281d58e8ec7ccec967169
Automates Notion test case 441 (New Book Inherits Stage [Automated portion]): https://app.notion.com/p/New-Book-Inherits-Stage-3904bb19df1281c5afd2d91537be1be0 (its BloomPack step, which needs a BloomPack template, moved to manual test case 829: https://app.notion.com/p/New-Book-Inherits-Stage-Manual-portion-3e54bb19df128122ae48dd9ae00b39bb)
Automates Notion test case 442 (Book Remembers Its Stage): https://app.notion.com/p/Book-Remembers-Its-Stage-3904bb19df128169a8a4c33807dbed76
Automates Notion test case 460 (New Book Inherits Level): https://app.notion.com/p/New-Book-Inherits-Level-3904bb19df128157a03cc91627fd1e9a
Automates Notion test case 517 (Pasting With the Tool Open Doesn't Corrupt Audio Markup): https://app.notion.com/p/Pasting-With-the-Tool-Open-Doesn-t-Corrupt-Audio-Markup-3904bb19df1281a597d0d16f9e574812
Automates Notion test case 830 (Toolbox: turning tools on and off, and which tool is open): https://app.notion.com/p/Toolbox-turning-tools-on-and-off-and-which-tool-is-open-3e54bb19df128178873ce6cdb32cf20e

Ref: https://issues.bloomlibrary.org/youtrack/issue/BL-16608

🤖 Generated with Claude Code

Devin review


This change is Reviewable

andrew-polk and others added 3 commits September 23, 2026 18:04
Characterization tests for the toolbox infrastructure rewrite: they pass on
master today, so the rewrite has to keep them passing.

- toolbox-sections: turning tools on and off under "More..." (the real check
  box), section order, clicking the open tool's header, and the book
  remembering which tool was open. No manual card covered these.
- reader-tool-stage-and-level: each book keeps its own stage and level; a new
  book starts on the stage or level last chosen, not the one last seen
  (Notion test cases 441, 442, 460).
- decodable-reader-template: a book from the Decodable Reader template opens
  on that tool, on stage 1 (Notion test case 436).
- talking-book-paste: pasting a marked sentence with Talking Book open does
  not nest its markers (Notion test case 517, BL-10291).

Bloom production code: test ids on the reader tools' stage/level stepper and
on the "More..." check box rows.

Helper fix: makeBookFromTemplate now starts from the Collections tab, as a
person does. Making a book while the Edit tab showed one with a reader tool on
left the Edit tab showing the template, so a test's second book hung.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Also make the remembered-tool test check, before opening the Leveled Reader, that the book would not have opened it anyway; the old check ran after opening it and could not fail.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Devin pointed out that reopening the same book could pass on an in-memory setting alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread src/BloomE2E/tests/toolbox-sections.spec.ts
Comment thread src/BloomE2E/helpers/readerTools.ts
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 following a prompt from Andrew] Consulted Devin on 2026-09-23 up to commit a23754e: no bugs, two Investigate flags (one fixed in 3d79d48, one not an issue; see their threads), no informational items. 3d79d48 only adds one assertion to a test.

@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 following a prompt from Andrew] Consulted Devin on 2026-09-23 up to commit 3d79d48: no bugs; it marks the open-tool persistence flag resolved; the reader-restore flag is carried over unchanged (answered on its thread); no informational items.

@andrew-polk andrew-polk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrew-polk reviewed 11 files and all commit messages, and resolved 2 discussions.
Reviewable status: 0 of 11 files reviewed, all discussions resolved.

@andrew-polk
andrew-polk marked this pull request as ready for review September 24, 2026 04:56
@andrew-polk
andrew-polk merged commit 12e339f into master Sep 24, 2026
1 of 2 checks passed
@andrew-polk
andrew-polk deleted the BL-16608-toolbox-e2e branch September 24, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant