Cover who may restore a version, and what the blocked-attempts grid shows - #727
Merged
Conversation
…hows Restoring a historical version writes over the current account, so the test worth having is who is offered it: only a viewer who also has edit access. Both sides are asserted, through the real actions helper rather than a stand-in. The history view also refuses outright without a prior grant, and refuses when the per-account ACL denies viewing. Plus how a version is labelled in the date picker: by its editor once it has been edited, and by its creator for the first one — including when the edit date is stored as all zeroes, which is what the old schema wrote. For the blocked-attempts grid: the address as recorded, masked on a demo instance, and blank when there is none. The unlock action is offered only on rows that are still blocking — the filter reads inverted at first glance, but the row template hides an action when the field matches, so it is right; there is now an assertion saying so. Two gaps left deliberately: Version's 32-bit comparison path is dead on any 64-bit runtime and cannot be reached without mocking a language constant, and the grid's remaining branches are accessors and a repeat of a template check that is already covered.
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.
What
13 tests across the account history helper and the blocked-attempts grid, neither of which had a test file.
Who may restore a version
Restoring a historical version writes over the current account, so the test worth having is who is offered it: only a viewer who also has edit access. Both sides are asserted — the grant and the refusal — through the real actions helper rather than a stand-in, so it is the actual wiring being checked.
The history view also refuses outright without a prior grant, and refuses when the per-account ACL denies viewing.
Plus how a version is labelled in the date picker: by its editor once it has been edited, and by its creator for the first one — including when the edit date is stored as all zeroes, which is what the old schema wrote.
The blocked-attempts grid
The address as recorded, masked on a demo instance, and blank when there is none. The unlock action is offered only on rows that are still blocking.
That filter reads backwards at first glance — it filters on
tracked = 0— but the row template hides an action when the row's field matches the filter value, so it is correct. There is now an assertion saying so, which is the point of writing it down.Two gaps left deliberately
Version.php's 32-bit comparison path is dead on any 64-bit runtime and cannot be reached without mocking a language constant. The 64-bit path already has boundary tests.DataGridBase's remaining branches are plain accessors and a repeat of a missing-template check that is already covered on a sibling setter. One of them backs a property with no setter anywhere in the codebase.One finding, not acted on
ErrorBase::view()is dead code:final protected, and none of its four subclasses call it — they each returnActionResponse::ok($this->view->render())directly. Left uncovered rather than reached through an artificial subclass invented for the purpose.