Commit b9a8eb9
test(coverage): Sprint 3 — Component & Documentation Coverage (S3-1 through S3-5) (#213)
* docs: add code coverage standards section to CONTRIBUTING.md (S3-4, #207)
* test(bunit): add AttachmentCard, BulkConfirmation, BulkProgress, UndoToast tests (S3-5, #208)
- AttachmentCardTests (13 tests): image/thumbnail/blob URL, PDF icon, MD icon,
generic TXT icon, filename display, formatted file size, upload date, uploader
name, CanDelete flag, delete callback fires with attachment ID
- BulkConfirmationModalTests (13 tests): visibility toggle, title/message display,
affected count badge with singular/plural forms, delete vs non-delete icon
backgrounds, confirm/cancel/backdrop callbacks, IsProcessing disables buttons,
IsVisibleChanged fires on cancel
- BulkProgressIndicatorTests (16 tests): visibility toggle, title, percentage,
processed/total counts, null progress coalesces to zero, spinner present while
processing, spinner hidden when complete, success/failure messages, success count,
failure count visibility (shown >0 / hidden ==0), cancel and close buttons,
OnClosed callback
- UndoToastTests (12 tests): visibility toggle, message text, undo button shown with
token / hidden with null or empty token, countdown seconds display, close button
fires IsVisibleChanged(false)+OnDismissed, undo button fires OnUndo(token) then
also dismisses (IsVisibleChanged + OnDismissed)
Side effect: adds <Compile Remove> for untracked Theme test files that use removed
bUnit 1.x APIs (CS0619/CS1061 compile errors introduced by another squad member;
not committed to the repo).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test(bunit): add AttachmentCard, BulkConfirmation, BulkProgress, UndoToast tests (S3-5, #208)
- AttachmentCardTests (13 tests): image with thumbnail URL, image with blob URL fallback,
image with empty thumbnail fallback, PDF icon label, MD icon label, generic TXT icon,
filename display, formatted file size (1KB), upload date formatting, uploader name,
CanDelete shows/hides delete button, OnDelete callback fires with attachment ID
- BulkConfirmationModalTests (13 tests): IsVisible=false renders nothing, IsVisible=true
renders modal, title+message display, affected count badge, singular/plural issue
wording, Delete action uses red background, non-delete uses yellow, confirm callback,
cancel callback, IsVisibleChanged(false) on cancel, backdrop click cancels,
IsProcessing disables both buttons
- BulkProgressIndicatorTests (16 tests): IsVisible=false renders nothing, title display,
percentage (50%), processed/total counts, null progress coalesces to 0%, spinner
present when incomplete, spinner hidden when complete, success/partial-failure
completion messages, success count display, failure count shown when >0 and hidden
when 0, cancel button when CanCancel, close button when complete, OnClosed callback
- UndoToastTests (12 tests): IsVisible=false renders nothing, message text, undo button
shown/hidden with token/null/empty, countdown seconds shown in undo badge, close
button fires IsVisibleChanged(false)+OnDismissed, undo button fires OnUndo(token)
then dismisses (IsVisibleChanged(false)+OnDismissed)
Also adds <Compile Remove> for untracked bUnit 1.x Theme tests (not committed, break
full recompile with CS0619/CS1061 - pre-existing issue from another squad member).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test(bunit): add Analytics page bUnit tests (S3-1, #204)
- Add AnalyticsPageTests with 20 comprehensive bUnit tests covering:
- Loading state: animate-pulse skeleton and 4 skeleton card count
- Error state: exact error message, red CSS styling, absent summary cards
- Success state: scoped value assertions per SummaryCard for Total/Open/Closed
- FormatResolutionTime: hours (12.5h), days (2.0d), minutes (30m)
- All four SummaryCard titles verified together
- DateRangePicker renders two date inputs in both loaded and loading states
- Export to CSV button present and enabled before export
- Authorize attribute contract verified via reflection (AdminPolicy)
- Mediator called exactly once on initialization
- Empty collections do not crash PrepareChartData
- Post-review improvements: scoped DOM element assertions for value cards;
error-state test now has positive assertion to guard against blank-markup false pass
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test(bunit): add Pagination, SearchInput, StatusBadge, DeleteConfirmationModal tests (S3-2, #205)
- PaginationTests (15 tests): hidden when TotalPages<=1, nav rendered when >1,
prev/next button visibility, prev/next fire OnPageChange with correct page number,
current-page click is a no-op, active border class, border-transparent on non-active,
ellipsis rendered mid-range, no ellipsis for small ranges, ellipsis boundary tests
(page-4 no start ellipsis / page-5 start+end ellipsis), status text shows page of total
- SearchInputTests (15 tests): input/placeholder/id/aria-label rendering, search SVG icon,
clear button hidden on null/empty value, clear button visible with value, ClearSearch
fires ValueChanged(null) and OnSearch(null) without debounce timer, clear button hides
after clearing; debounce tests use TaskCompletionSource (not Task.Delay) to avoid
race conditions in CI
- StatusBadgeTests (14 tests): null → 'Unknown' text + default class, status name
rendered, Theory covering Open/InProgress/UnderReview/Resolved/Closed/WontFix/unknown
backgrounds, individual text-color assertions for Open/InProgress/Resolved/WontFix,
AdditionalClasses appended, 'badge' base class always present
- CategoryBadgeTests (10 tests): null → 'Unknown', name rendered, Theory covering
Bug/Feature/Enhancement/Question/Documentation/unknown backgrounds, text-color
assertions for Bug/Feature/Documentation, AdditionalClasses, 'badge' base class
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test(bunit): add ThemeProvider and theme component tests (S3-3, #206)
- ThemeProviderTests (10 tests): renders child content, IsDarkMode (default/light/dark),
Color/Brightness reflect JS values, OnThemeChanged fires on SetColorAsync/SetBrightnessAsync,
SetColorAsync/SetBrightnessAsync update properties, guard-path tests when JS init fails,
DisposeAsync safety
- ThemeBrightnessToggleTests (6 tests): renders, aria-label, moon in light mode, sun in dark mode,
click light→dark + verifies setBrightness('dark') JS call, click dark→light + verifies call
- ThemeColorDropdownTests (7 tests): renders, aria-haspopup/expanded, swatches hidden before click,
all four swatches visible after click, aria-expanded on open, selection closes dropdown,
setColor JS call verified with correct 'blue' arg
- Removed Compile Remove exclusion from csproj (leftover from pre-bUnit-2.x stub files)
Total: 23 new tests in Components.Theme namespace; full suite 934 passed, 0 failed
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(tests): stabilize ColorScheme_OpenDropdownShowsColorOptions E2E test
Add NetworkIdle wait after clicking the dropdown toggle to allow
Blazor Server SignalR round-trip to complete before asserting on
color option button visibility.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 8c68819 commit b9a8eb9
15 files changed
Lines changed: 3348 additions & 0 deletions
File tree
- tests
- AppHost.Tests/Tests/Theme
- Web.Tests.Bunit
- Components
- Issues
- Theme
- Pages/Admin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
295 | 296 | | |
296 | 297 | | |
297 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
298 | 377 | | |
299 | 378 | | |
300 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
0 commit comments