Repository navigation
Names the code the onboarding sabotage mutates - #285
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 pernote. 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:
JourneyHost.path_options/1:errorJourneyHost.focus/3JourneyHost.target/1JourneyHost.stepped/3JourneyHost.back/2JourneyAccess.start_scope/2and the page'sAccess.check/4before a startThe 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/2answering:errorfor a non-librarian, andAccess.check/4refusing a scopethe 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 withoutinherited_metadata_keys:,JourneyAccess.member?/2answering true,and the page's
load/2answering 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 booleanquestion" 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"becomestrue, an unticked onefalse; see the component'sJourneymoduledocin 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
mix quality) green on the branch head: format,compile with warnings as errors, credo, dialyzer and the whole test
suite pass.
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/2alone, which is new test code beyond this bead.