Skip to content

Names the code the onboarding sabotage mutates - #285

Merged
johnnyt merged 1 commit into
mainfrom
se-dil2-stale-journey-comments
Nov 28, 2026
Merged

johnnyt merged 1 commit into
mainfrom
se-dil2-stale-journey-comments

Conversation

@johnnyt

@johnnyt johnnyt commented Nov 28, 2026

Copy link
Copy Markdown
Member

The onboarding page test's sabotage notes were written when the page
held its own clauses. The page now draws through the shared Journey
component and its host, so several notes named code that is gone. This
rewrites them against the code they mutate today, and drops one guard
whose reason is gone. Comments and one test only; no library code
changes.

What changed

Onboarding page test (onboarding_journey_live_test.exs), one row per
note. Each mutation was applied to the host or page code, the file was
confirmed changed, the test run turned the named test red on an
assertion (not a compile or runtime error), and the file was restored
and confirmed byte-equal to HEAD:

Note now names Mutation Test that turned red
JourneyHost.path_options/1 the onboarding key answers :error "the page runs the branch onboarding and starts on its first screen" (and the other tests of the file)
JourneyHost.focus/3 answers the named execution with the page's options for every Path "a pick presents the first picked setup's screen, the child's own"; "a reload of the onboarding URL presents the running setup"
JourneyHost.target/1 answers the execution on the URL with the page's options "presses go to the child, and a finished setup moves on to the next pick"
JourneyHost.stepped/3 tells the press's own view for the onboarding too "after the last pick finishes, the onboarding shows its closing screen"
JourneyHost.back/2 sends the back request to the execution on the URL "Back inside a setup goes back between the setup's own steps" (the only test red)
JourneyAccess.start_scope/2 and the page's Access.check/4 before a start the first answers the riverside scope for every actor and the second is dropped "a visitor who is no librarian is refused Start on the onboarding", on the execution count

The last row is a correction, not only a rename. The old note said the
test went red when the page started the onboarding without asking the
access module. Either change alone leaves the test green: each of the two
guards before the host starts a Journey (start_scope/2 answering
:error for a non-librarian, and Access.check/4 refusing a scope
the actor is not a member of) refuses the start alone. The note now names the pair that
does turn it red, and says either alone does not.

The notes on the inherited scope and the two refusals were re-run
against the current code (Durable's driver without
inherited_metadata_keys:, JourneyAccess.member?/2 answering true,
and the page's load/2 answering a reason without asking membership);
each turned its named test red on an assertion, so their text stands.

Setups test (setups_test.exs): the guard "no setup asks a boolean
question" is dropped. It was written because the Journey page did not
convert a boolean answer. The component now types the form's values the
way riddler validates them (a boolean question's "true" becomes
true, an unticked one false; see the component's Journey moduledoc
in riddler_live_view 0.2.0, the version the lock resolves), so the
constraint has no reason left, and a setup that asks one is no longer
refused by anything. The guard held for every setup at the time of the
change, so dropping it changes no test outcome.

Left as it is

The signup journey page test keeps its sabotage notes unchanged. Its
fixtures and the tests built on them stay exactly as they are under the
repo's fixture rule for the signup wizard, which this change does not
touch.

Verification

  • Full quality gate (mix quality) green on the branch head: format,
    compile with warnings as errors, credo, dialyzer and the whole test
    suite pass.
  • riddler resolved at 0.9.0 and riddler_live_view at 0.2.0 by the lock.
  • Acceptance checked against the live code: each rewritten note's
    function exists at the cited name and its mutation was re-run (table
    above); the guard is dropped with the reason above.

Provenance

Choosing to drop the boolean guard rather than restate it is an
engineering call inside the footprint: nothing else asserts it, and a
restated guard would pin a limit the component no longer has.

Review

In-turn review round (diff critic and test critic) before opening. One
finding accepted: the start-refusal note first gave the wrong reason
for the redundancy, now corrected. One not taken: a unit test on
start_scope/2 alone, which is new test code beyond this bead.

The onboarding page test's sabotage notes named page clauses that
moved to the shared Journey page when it went onto the component:
focus/2, target/1, refocus/1 and the back clause. Each note now names
the host function it mutates today (focus/3, target/1, stepped/3 and
back/2), and each mutation was re-run against it and turned the named
test red on an assertion.

The note on the start refusal named one change that does not turn
the test red alone: each of the two guards before the host starts a
Journey refuses the start by itself. It now names the pair of changes
that does, which was re-run.

The guard that no setup asks a boolean question said the Journey page
does not convert a boolean answer. The component converts it, so the
guard has no reason left and is dropped.

Refs: se-dil2
@johnnyt
johnnyt merged commit ea92661 into main Nov 28, 2026
4 checks passed
@johnnyt
johnnyt deleted the se-dil2-stale-journey-comments branch November 28, 2026 13:36
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