Repository navigation
fix(web): close the shared Library page review follow-ups - #262
Conversation
#196.7: DialogSafetyTests no longer reaches the shared Library page's private CloseForm by reflection. CloseForm is internal, the Web project grants InternalsVisibleTo the Web test project, and the late-save test closes the dialog through EventCallback.Factory.Create on the page, so the renderer re-renders as it does after a real event (no reflected StateHasChanged). The reflection on _edit and CancelForm was already gone (#210); this was the last of it on the Library page. What the test asserts is unchanged. The other #196 items were already closed on dev, mostly by #210; the PR records a disposition and evidence for each. Refs #196
DISPOSITION (#196, items 1 to 15)
Counts (cold, worker): base and head both 0 errors, 0 warnings; Api 901 + 2 skipped; Web 1245; E2E 5 + 13 skipped. Mutations M1 (dialog token ignored) and M2 (CloseForm no-op): both red, restored. Live flows P1-P6: 6/6 on branch and on control. Observations for Nerd
|
Summary
🎉 No failed tests in this run. Github Test Reporter by CTRF 💚 |
|
Nerd review of f1b262a DISPOSITION: matches card w25. The audit found 12 of 15 items already done by #210/#211 (evidence per item in the worker comment; I spot-checked #196.1, #196.3, #196.4 and #196.10 against dev); #196.7 DONE here; #196.14 and #196.15 DECLINED (history, not code). Diff: 3 files, 13 insertions, 7 deletions. Cold build (own worktree at f1b262a): 0 errors, 0 warnings; Api 901 passed + 2 skipped (903), Web 1245 passed, E2E 5 passed + 13 skipped (18). Counts unchanged from dev 13e2b31. Mutation (own re-run): making Live run: skipped by me. The page behaviour is unchanged (visibility modifier only) and the worker's flows P1-P6 passed 6/6 on branch and control. Follow-up: the same reflection pattern remains on the Events side ( |
…ard and DST behaviour (#264) > *AI-generated by Nerd Bender (kanban t_4005af78); maintainer review required.* ## Summary This PR adds tests for the review follow-ups in #233 on the recurring Event create UI, plus one sentence in ADR 0002 and one in the glossary. It changes no production code. Every item was audited against `origin/dev` at `c098abe` first. None of items 1 to 3 was already covered: no test pinned the anchor rule on both sides, and no browser check or DST test existed for this section. ## Change - **#233.1, the first-Occurrence rule** (`Api.Tests/Series/FirstOccurrenceTests.cs`, 7 tests). A Series' start is its anchor, not always an Occurrence. Weekly, every-other-week and same-date rules make the anchor itself. An nth-weekday rule whose date the anchor is not never makes the anchor, and starts at the next rule date (the same month, or the next one when that month's date has passed). The same goes for a holiday rule on a date that is not that holiday. The generator is unchanged. - **ADR 0002 and GLOSSARY.md**: "the instant of its first Occurrence" now says the start is an anchor, and the first Occurrence is the first rule date at or after it. That one sentence in each file is the only doc edit. - **#233.2, keyboard** (`E2ETests/RepeatKeyboardFlows.cs`, 1 browser flow). Tab from Event Time reaches the Repeat switch. Space turns it on, and Tab then goes Repeats, then Ends on (optional). Two ArrowDown presses on the closed Repeats select move Weekly to Every other week to Monthly on the nth weekday, and Tab then goes Repeats, Week of the month, Weekday, Ends on (optional). Enter, End and Enter pick Yearly on a holiday, and Tab then goes Repeats, Holiday preset, Ends on (optional). Space turns the switch off and the rule select goes. - **#233.3, DST** (`Web.Tests/RepeatSectionDstTests.cs`, 2 bUnit tests). These save a weekly Series from the create dialog with the browser zone pinned to America/Chicago: - Spring: start 4 March 2027 at -06:00, end date 18 March, which is summer time. - Autumn: start 22 October 2026 at -05:00, end date 5 November, which is winter time. Both check the end sent on the wire (the end date at the start's time and the start's own offset). They also run the sent schedule through `OccurrenceGenerator`, so the Occurrence on the end date is still made. ## Validation All builds below are cold (`clean-build.sh`) at `origin/dev` `c098abe` (the merge of #262). The base did not move before the push. | | Errors | Warnings | Api.Tests | Web.Tests | E2E without a stack | |---|---|---|---|---|---| | Baseline | 0 | 0 | 901 passed + 2 skipped = 903 | 1245 | 5 passed + 13 skipped = 18 | | After | 0 | 0 | 908 passed + 2 skipped = 910 (+7) | 1247 (+2) | 5 passed + 14 skipped = 19 (+1) | No test was removed, renamed or changed. The additions are: - Api: `Weekly_and_every_other_week_make_the_picked_instant_itself` ×2, `A_same_date_rule_makes_the_picked_instant_itself` ×2, `An_nth_weekday_already_past_in_the_picked_month_starts_the_next_month`, `An_nth_weekday_off_the_picked_date_never_makes_the_picked_instant`, `A_holiday_rule_off_the_picked_date_starts_at_the_next_holiday`. - Web: `AnEndDateAfterTheSpringChange_…`, `AnEndDateAfterTheAutumnChange_…`. - E2E: `Tab_ReachesTheRepeatSwitch_ThenEachRuleSelectAndTheEndDate_AndTheKeyboardWorksThem`. **Mutations.** Each was a throwaway change, restored before the commit. | Mutation | Result | |---|---| | M1a: the generator also yields the anchor for monthly, yearly and holiday rules | 3 red: the nth-weekday-past, nth-weekday-off and holiday tests (for example, got `[2026-12-10…, 2027-01-01…]`) | | M1b: the generator skips the anchor | 4 red: weekly, every other week, monthly same date, yearly same date. Both DST tests also went red. | | M3: `RepeatChoice.EndFor` reads the end date at the viewer's offset | both DST tests red (the end string is not at the start's offset), plus the existing `TheSchedule_KeepsTheStartsOffset_AndPutsTheEndAtItsTimeAndOffset` | | M2a: `tabindex="-1"` on the Weekday FluentSelect | **stayed green**. A browser probe showed the web component renders `tabindex=0` anyway, and Tab from Week of the month still lands on Weekday. This mutation does not remove the control from the tab order (see Observations). | | M2b: `Disabled="true"` on the Weekday FluentSelect | **red**: Tab from Week of the month skipped to Ends on (optional). `ToBeFocusedAsync` on Weekday timed out with "unexpected value inactive" at `RepeatKeyboardFlows.cs:53`. | **Browser runs (by the worker, on a with-slot stack, headless Chromium).** - Branch, before commit: the full E2E suite with `EM_E2E_REQUIRED=1` passed 19 of 19, the new flow included (6 s). - Committed head `4559062`, on a fresh slot with a clean worktree: the full E2E suite with `EM_E2E_REQUIRED=1` passed 19 of 19, `Tab_ReachesTheRepeatSwitch_…` included (7 s). - Control: the new flow does not exist on plain `origin/dev`, so a control run would only show the other 18. The same suite gave 18 of 18 there in Nerd's baseline. The tab-order probe (`probe233.mjs`) ran against this branch, whose Web project is identical to `dev`. It printed this focus order: Event Name, Event Date, Event Time (4 stops: the input's own fields), Repeat. With the switch on, after Repeat: Repeats, Ends on (optional), Themed Activities Only. With Monthly on the nth weekday: Repeats, Week of the month, Weekday, Ends on (optional). With Yearly on a holiday: Repeats, Holiday preset, Ends on (optional). - The DST checks are bUnit only, not run in a browser. The date picker's popup does not open in headless Chromium, and #233.3 needs no browser. ## Notes `Refs #233`; nothing is closed automatically. Nerd closes the issue by hand once every item has a disposition (see the comment).
Summary
The last open item of #196, the follow-ups from the review of the shared Library page (#192). The audit against
origin/dev13e2b31 found 13 of the 15 items already closed ondev, almost all by #210. #196.14 and #196.15 are history, not code. The one item still open in code was the rest of #196.7:DialogSafetyTestsstill called the Library page's privateCloseFormby reflection. This PR replaces that call with an internal seam. The per-item dispositions are in the table below and are repeated as a PR comment.Change
LibraryPage.razor:CloseFormisinternalinstead ofprivate. A one-line comment says why: no page event can close the dialog while a save runs, and the test needs to do exactly that. The method body is unchanged.MW-GC.EventManager.Web.csproj:<InternalsVisibleTo Include="MW-GC.EventManager.Web.Tests" />. Design call (the smallest seam): the Web project had noInternalsVisibleTobefore. The API project already grants the same access to both test projects (MW-GC.EventManager.API/Properties/AssemblyInfo.cs). A public method would have widened the component's API instead.DialogSafetyTests.SaveFinishingAfterCancelAndReopen_DoesNotCloseOrResetTheNewerDialog: the test closes the dialog throughEventCallback.Factory.Create(library, library.CloseForm).InvokeAsync()on the renderer. The renderer then re-renders the page as it does after a real event, so the reflectedStateHasChangedcall is gone too. Every assertion is unchanged. The_editandCancelFormreflection that refactor(web): follow-ups from the review of the shared Library page follow-ups (#192) #196.7 also named was already gone ondev: the test reads the newer dialog through the page, andCancelButton_IsIgnoredWhileSaveInFlightuses the Cancel button's own handler.CloseThroughhelper stays forEventEditDialog.CloseCustomize, which is outside refactor(web): follow-ups from the review of the shared Library page follow-ups (#192) #196 (see Observations). Its comment now names only that use.DISPOSITION (#196, items 1 to 15)
GameService.csis deleted.Events.razor:5,Stats.razor:5andActivityPerformancePanel.razor:9injectLibraryClient<GameEntity>. Only oneGET api/gamesrow is left (ServiceRouteContractTests.cs:71).GameReadersTestscovers each reader.LibraryFieldMessage.razor.js:11setsariaDescribedByElementson the inner input. The accessibility tree was checked in a browser in #210's evidence. The Game picker is covered byActivitiesPageTests.cs:167. This PR did not re-run that browser check.LibraryField.cs:33readsread(item) ?? string.Empty. Test:LibraryPageTests.Search_AnItemWithNoName_CountsAsEmpty(:77).Program.cs:12calls onlyAddAppServices. Test:LibraryClientTests.AppServices_RegisterTheFourLibraryClients(:68). #210 mutation M3 removedAddLibraryClients, and the test went red.LibraryPageTests.cs:99-103renders Activities with a row and checks that the row shows.ActivitiesPageTests.cs:156-165asserts the form's own "Game is required." and compares refusals with the API's, not its text.CloseForm: an internal seam, called on the renderer._editandCancelFormwere already off reflection (#210, #211).ViewToggle_IsOfferedOnlyToAPageWithACardTemplateOrIcon. NoGetRawConstantValueis left.LibraryServices.csis the one shared, disposed provider. Message-id uniqueness is documented onLibraryField.MessageId(LibraryField.cs:16-21).ThemesHolidaysPageTests.cs:128-130puts the title and icon type in theDataRow, uses plainusinglines, and has no fully-qualified names.LibraryPageTests.csis 227 lines, split intoLibraryEditorTests(288),GamesWebsiteTests(171),LibraryClientTests(118) andLibraryPageFixture(150).LibraryPage.razoris 380 lines after this PR (379 before).LibraryItemButton.razorholds the one Edit/Delete markup.Activities.razor:272hasDetailsKey.LibraryName<T>and the typedLibraryFieldkey are in place.RowActionexposes onlyAnyBusy; theRunningalias is gone andEventList.razor:68usesAnyBusy.LibraryPage.razor:300-309unsubscribes on close and inDispose. Test:LibraryEditorTests.Editor_AClosedEditorsForm_NoLongerRendersThePage.AddLibraryClientslives inLibraryClients.cs.Validation
All numbers come from a cold build (
clean-build.sh, thenbuild --no-incremental, thentest --no-build), run by the worker.Count preservation: no test was added, removed, renamed or split, so 1245 before and after. One existing test changes how it closes the dialog; none of its assertions change.
Break-it mutations on
SaveFinishingAfterCancelAndReopen_DoesNotCloseOrResetTheNewerDialog, each applied toLibraryPage.razorand then restored (the restore was checked byte for byte):var current = true;). The test goes red atpage.DialogTitle(): the late save closed the newer dialog.CloseFormdoes nothing. The test goes red atAssert.IsFalse(page.HasFormDialog()).Live run by the worker, through
with-slot.shon slot 0 (Azurite + API + Release web build behind SWA, headless Chromium, admin cookie). The script seeds two Games, one Activity and one Event through the API.origin/dev13e2b31GET api/games)There were no console errors on either side, and
api_flows.pypassed 10 of 10 on both. The first branch run reported P2 as FAIL: the script's open-dialog check used Playwright'svisible=trueon thefluent-dialoghost, whose box lives in its shadow root. That was a bug in the script, not in the app (the same run saved the rename and stored it). The check was fixed to test whether the element is present, and the run above is the re-run. The repo E2E suite was not run against a live slot here, because no E2E file changed. The #196.2 accessibility-tree check was not re-run.Notes
Refs #196, notCloses. Every item above has a disposition, so Nerd can close refactor(web): follow-ups from the review of the shared Library page follow-ups (#192) #196 by hand.Observations for Nerd
EventEditDialog.CloseCustomizeis still called by reflection inDialogSafetyTests.cs:230andEventsPageWiringTests.cs:227, andEventDetailsDialog.CloseDetailsinEventsPageWiringTests.cs:245. These are the same pattern on the Events side, outside refactor(web): follow-ups from the review of the shared Library page follow-ups (#192) #196. Now that the Web project grantsInternalsVisibleTo, the same one-line seam would retireCloseThroughand itsSystem.Reflectionimport in both files.UnrenderedEventsPage.cs,FeedbackPageTests.csandEventMetricsFormTests.csalso use reflection. Those are other issues; I did not check them against the new seam.