Repository navigation
Tests the Journey access design end to end - #276
Merged
Merged
Conversation
One test module drives the Journey page on SQLite. A person outside a Journey's scope cannot mount it, submit on it or go back on it. A setup the branch onboarding runs as a durable child is checked against the branch scope it inherited. The patron registration's PIN reaches no HTML the page draws. An outsider is never drawn the form, so a submit or a back request is driven by replacing the actor the component holds, on a page a member mounted, with an outsider's; another member put in the same way is let through. Refs: se-uea8
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.
Adds one test module that proves the Journey page's access design end to end on the app's SQLite database (the suite's own
StatifierExamples.Reposandbox; no second database setup). Tests only: nothing underlib/changes.What it proves
How an outsider's submit and back are driven
An outsider is never drawn the form or the Back control, because
RiddlerLiveView.Journeyasks the access module before it draws. Pressing on a page an outsider loaded would test a missing form. So a member mounts the page and is drawn the form, and the test then replaces the actor the component holds with an outsider's before the press (:sys.replace_stateon the LiveView process). The screen, form, button and Journey are unchanged, so the component'sRiddler.Journey.Access.check/4for:submitor:backis the only thing between the press and the host. The same replacement with another member of the scope goes through, so the replacement alone is not what refuses. It stands in for an access answer that changes mid-Journey; this app's actor comes from the session, which does not change under a running page.What is not covered, and why
No Path this app runs offers Back to or from the screen that asks the PIN, so the secret test has no Back step. A fresh mount after the PIN is stored stands in for it. Adding such a Path would mean a new fixture, and this change adds none.
Sabotage notes (each run, each restored byte-equal)
JourneyAccess.member?/2answeringtruefor every scope: the mount, submit and back tests each went red on their refusal assertion.inherited_metadata_keys:set to[]: the child recorded no scope, the riverside librarian's page was refused the setup's screen, and the submit test went red.Signup.Journeyanswering the responses unsealed: a page drawn after the press carried the PIN, and the secret test went red.Gate and review
Full
mix qualitygreen on the committed tree. Review tier: gate (tests only, under the size threshold). The pre-request review round (diff critic, test critic) ran on the branch before this request opened.