Repository navigation
docs(qa): canonical user-story tracker and dialog landmarks #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
032dcf5
docs(qa): add canonical user-story tracker and dialog landmarks
adamgell 9619578
fix(log): apply cached tab snapshot before folder restore
adamgell 5d74650
fix(qa): align tracker and File Open IME/dsregcmd paths
adamgell 58332b7
fix(qa): close CodeRabbit typecheck and tab-switch gaps
adamgell e06fc81
fix(timeline): keep empty folder opens as a no-op
adamgell 67e3d3f
fix(qa): close CodeRabbit review gaps for tracker
adamgell edf71c0
test: isolate SecureBoot platform fixture
adamgell 14da6cf
fix: close PR 577 review regressions
adamgell e8eaa1d
fix: close async source loading races
adamgell 87074a4
fix: isolate dropped path failures and stale restores
adamgell b1a06a5
fix: harden IPC responses and stale source loads
adamgell 8d4b4b9
test: stabilize remaining PR 577 fixtures
adamgell 6180f42
fix: validate every frontend command response
adamgell 28352ae
fix: align E2E association status fixture
adamgell dff078a
fix: keep workspace decoder IDs exhaustive
adamgell f2ef5b1
fix: derive IPC responses from decoder registry
adamgell 0aaa618
fix: harden workspace source loading
adamgell 306f8cc
fix: preserve stale source load semantics
adamgell 932857e
fix: close review gaps in source loading and timeline actions
adamgell 16fc8ad
fix: reset replacement and progress ownership synchronously
adamgell 4262a77
fix: close remaining review findings
adamgell 51f2aef
fix: propagate event log parse failures
adamgell c9e7331
fix: close remaining review findings
adamgell 6e584ef
test: close PR 577 review gaps
adamgell 6737f27
test: close remaining PR 577 review gaps
adamgell 75b0ea3
fix: close remaining PR 577 review gaps
adamgell 329fdcc
fix: close remaining PR 577 review gaps
adamgell b427fa9
test: close remaining PR 577 review gaps
adamgell de71d85
fix: close remaining PR 577 review gaps
adamgell 65a3504
fix: cover keyboard and selection review gaps
adamgell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
101 changes: 101 additions & 0 deletions
101
src/components/dialogs/CollectDiagnosticsDialog.test.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| import { cleanup, fireEvent, render, screen } from "@testing-library/react"; | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
| import { CollectDiagnosticsDialog } from "./CollectDiagnosticsDialog"; | ||
| import { CollectionCompleteDialog } from "./CollectionCompleteDialog"; | ||
| import { useUiStore } from "../../stores/ui-store"; | ||
| import { COLLECTION_PRESETS } from "../../lib/collection-categories"; | ||
|
|
||
| const collectDiagnostics = vi.hoisted(() => vi.fn()); | ||
|
|
||
| vi.mock("../../lib/commands", () => ({ | ||
| collectDiagnostics, | ||
| })); | ||
|
|
||
| vi.mock("../../lib/log-source", () => ({ | ||
| loadPathAsLogSource: vi.fn(), | ||
| })); | ||
|
|
||
| describe("CollectDiagnosticsDialog", () => { | ||
| afterEach(() => { | ||
| cleanup(); | ||
| useUiStore.setState({ collectionProgress: null, collectionResult: null }); | ||
| }); | ||
|
|
||
| it("exposes a dialog landmark when open", () => { | ||
| render(<CollectDiagnosticsDialog isOpen onClose={() => {}} />); | ||
| const dialog = screen.getByRole("dialog", { name: "Collect Diagnostics" }); | ||
| expect(dialog).toHaveAttribute("aria-modal", "true"); | ||
| }); | ||
|
|
||
| it("shows presets, category checkboxes, and starts collection", async () => { | ||
| collectDiagnostics.mockResolvedValue({ | ||
| bundlePath: "C:/Users/Public/cmtrace-bundle", | ||
| bundleId: "bundle-1", | ||
| artifactCounts: { collected: 4, missing: 1, failed: 0, total: 5 }, | ||
| durationMs: 1200, | ||
| gaps: [{ artifactId: "cbs", category: "general", reason: "not present" }], | ||
| }); | ||
| const onClose = vi.fn(); | ||
| render(<CollectDiagnosticsDialog isOpen onClose={onClose} />); | ||
|
|
||
| expect(screen.getByText("Collect Diagnostics")).toBeInTheDocument(); | ||
| expect(screen.getByText("Quick Presets")).toBeInTheDocument(); | ||
| for (const preset of COLLECTION_PRESETS) { | ||
| expect(screen.getByRole("button", { name: preset.label })).toBeInTheDocument(); | ||
| } | ||
| expect(screen.getByText("Intune & MDM")).toBeInTheDocument(); | ||
| expect(screen.getByText("Autopilot & Provisioning")).toBeInTheDocument(); | ||
|
|
||
| fireEvent.click(screen.getByRole("button", { name: "Intune + Autopilot" })); | ||
| fireEvent.click(screen.getByRole("button", { name: "Collect" })); | ||
| expect(onClose).toHaveBeenCalled(); | ||
| expect(collectDiagnostics).toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("CollectionCompleteDialog", () => { | ||
| afterEach(() => { | ||
| cleanup(); | ||
| }); | ||
|
|
||
| it("exposes a dialog landmark when complete", () => { | ||
| render( | ||
| <CollectionCompleteDialog | ||
| onClose={() => {}} | ||
| result={{ | ||
| bundlePath: "C:/Users/Public/cmtrace-bundle", | ||
| bundleId: "bundle-1", | ||
| artifactCounts: { collected: 4, missing: 1, failed: 0, total: 5 }, | ||
| durationMs: 1500, | ||
| gaps: [], | ||
| }} | ||
| />, | ||
| ); | ||
| const dialog = screen.getByRole("dialog", { name: "Collection Complete" }); | ||
| expect(dialog).toHaveAttribute("aria-modal", "true"); | ||
| }); | ||
|
|
||
| it("shows counts, gaps, Close, and Open Bundle", () => { | ||
| const onClose = vi.fn(); | ||
| render( | ||
| <CollectionCompleteDialog | ||
| onClose={onClose} | ||
| result={{ | ||
| bundlePath: "C:/Users/Public/cmtrace-bundle", | ||
| bundleId: "bundle-1", | ||
| artifactCounts: { collected: 4, missing: 1, failed: 0, total: 5 }, | ||
| durationMs: 1500, | ||
| gaps: [{ artifactId: "cbs", category: "general", reason: "CBS.log not present" }], | ||
| }} | ||
| />, | ||
| ); | ||
| expect(screen.getByText("Collection Complete")).toBeInTheDocument(); | ||
| expect(screen.getByText("Collected")).toBeInTheDocument(); | ||
| expect(screen.getByText("Missing")).toBeInTheDocument(); | ||
| expect(screen.getByText("Failed")).toBeInTheDocument(); | ||
| fireEvent.click(screen.getByRole("button", { name: /Show 1 missing/i })); | ||
| expect(screen.getByText(/CBS.log not present/)).toBeInTheDocument(); | ||
| expect(screen.getByRole("button", { name: "Close" })).toBeInTheDocument(); | ||
| expect(screen.getByRole("button", { name: "Open Bundle" })).toBeInTheDocument(); | ||
| }); | ||
| }); |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,175 @@ | ||
| import { fireEvent, render, screen, waitFor } from "@testing-library/react"; | ||
| import { beforeEach, describe, expect, it, vi } from "vitest"; | ||
| import { inspectEvidenceArtifact, inspectEvidenceBundle } from "../../lib/commands"; | ||
| import { useLogStore } from "../../stores/log-store"; | ||
| import { useUiStore } from "../../stores/ui-store"; | ||
| import type { EvidenceBundleDetails, EvidenceBundleMetadata } from "../../types/evidence"; | ||
| import { EvidenceBundleDialog } from "./EvidenceBundleDialog"; | ||
|
|
||
| vi.mock("../../lib/commands", () => ({ | ||
| inspectEvidenceBundle: vi.fn(), | ||
| inspectEvidenceArtifact: vi.fn(), | ||
| })); | ||
|
|
||
| vi.mock("../../hooks/use-app-actions", () => ({ | ||
| useAppActions: () => ({ | ||
| openPathForActiveWorkspace: vi.fn(), | ||
| }), | ||
| })); | ||
|
|
||
| const inspectEvidenceBundleMock = vi.mocked(inspectEvidenceBundle); | ||
| const inspectEvidenceArtifactMock = vi.mocked(inspectEvidenceArtifact); | ||
|
|
||
| function metadata(overrides: Partial<EvidenceBundleMetadata> = {}): EvidenceBundleMetadata { | ||
| return { | ||
| manifestPath: "/tmp/bundle/manifest.json", | ||
| notesPath: "/tmp/bundle/notes.md", | ||
| evidenceRoot: "/tmp/bundle/evidence", | ||
| primaryEntryPoints: ["evidence/ime.log"], | ||
| availablePrimaryEntryPoints: ["evidence/ime.log"], | ||
| bundleId: "bundle-fixture", | ||
| bundleLabel: "Fixture evidence bundle", | ||
| createdUtc: "2026-08-18T12:00:00Z", | ||
| caseReference: "CASE-018", | ||
| summary: "Minimal fixture inventory.", | ||
| collectorProfile: "quick", | ||
| collectorVersion: "1.0.0", | ||
| collectedUtc: "2026-08-18T12:00:00Z", | ||
| deviceName: "TEST-PC", | ||
| primaryUser: "analyst", | ||
| platform: "windows", | ||
| osVersion: "10.0.26100", | ||
| tenant: "contoso", | ||
| artifactCounts: { | ||
| collected: 0, | ||
| missing: 0, | ||
| failed: 0, | ||
| skipped: 0, | ||
| }, | ||
| ...overrides, | ||
| }; | ||
| } | ||
|
|
||
| function details(overrides: Partial<EvidenceBundleDetails> = {}): EvidenceBundleDetails { | ||
| const meta = overrides.metadata ?? metadata(); | ||
| return { | ||
| bundleRootPath: "/tmp/bundle", | ||
| metadata: meta, | ||
| manifestContent: '{"bundleId":"bundle-fixture"}', | ||
| notesContent: "Collector notes.", | ||
| artifacts: [], | ||
| expectedEvidence: [], | ||
| observedGaps: [], | ||
| priorityQuestions: [], | ||
| handoffSummary: null, | ||
| ...overrides, | ||
| }; | ||
| } | ||
|
|
||
| function tabButton(container: HTMLElement, name: string): HTMLButtonElement { | ||
| const button = Array.from(container.querySelectorAll("button")).find( | ||
| (element) => element.textContent === name, | ||
| ); | ||
| if (!(button instanceof HTMLButtonElement)) { | ||
| throw new Error(`Missing tab button: ${name}`); | ||
| } | ||
| return button; | ||
| } | ||
|
|
||
| describe("EvidenceBundleDialog", () => { | ||
| beforeEach(() => { | ||
| vi.clearAllMocks(); | ||
| useUiStore.setState({ | ||
| activeView: "log", | ||
| activeWorkspace: "log", | ||
| }); | ||
| useLogStore.getState().clear(); | ||
| inspectEvidenceBundleMock.mockResolvedValue(details()); | ||
| inspectEvidenceArtifactMock.mockResolvedValue({ | ||
| path: "/tmp/bundle/evidence/ime.log", | ||
| intakeKind: "log", | ||
| summary: "log preview", | ||
| registrySnapshot: null, | ||
| eventLogExport: null, | ||
| }); | ||
| }); | ||
|
|
||
| it("renders nothing without bundle metadata", () => { | ||
| render(<EvidenceBundleDialog isOpen onClose={() => {}} />); | ||
| expect(screen.queryByText("Evidence Bundle")).not.toBeInTheDocument(); | ||
| expect(inspectEvidenceBundleMock).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("opens Summary/Inventory/Notes/Manifest and empty inventory copy from a store fixture", async () => { | ||
| useLogStore.getState().setBundleMetadata(metadata()); | ||
| useLogStore.getState().setActiveSource({ | ||
| kind: "folder", | ||
| path: "/tmp/bundle", | ||
| }); | ||
|
|
||
| const { container } = render(<EvidenceBundleDialog isOpen onClose={() => {}} />); | ||
|
|
||
| const dialog = container.querySelector('[role="dialog"]'); | ||
| expect(dialog).not.toBeNull(); | ||
| expect(dialog).toHaveAttribute("aria-modal", "true"); | ||
| expect(dialog).toHaveAttribute("aria-label", "Evidence bundle summary"); | ||
| expect(screen.getByText("Fixture evidence bundle")).toBeInTheDocument(); | ||
| expect(screen.getByText("Minimal fixture inventory.")).toBeInTheDocument(); | ||
| expect(tabButton(container, "Summary")).toHaveAttribute("aria-pressed", "true"); | ||
| expect(tabButton(container, "Inventory")).toBeTruthy(); | ||
| expect(tabButton(container, "Notes")).toBeTruthy(); | ||
| expect(tabButton(container, "Manifest")).toBeTruthy(); | ||
| expect(screen.getByText("Bundle metadata")).toBeInTheDocument(); | ||
| expect(screen.getByText("Primary evidence entry points")).toBeInTheDocument(); | ||
| expect(tabButton(container, "Close")).toBeTruthy(); | ||
|
|
||
| await waitFor(() => { | ||
| expect(inspectEvidenceBundleMock).toHaveBeenCalledWith("/tmp/bundle"); | ||
| }); | ||
| await waitFor(() => { | ||
| expect(screen.queryByText("Loading evidence bundle details...")).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| fireEvent.click(tabButton(container, "Inventory")); | ||
| expect(tabButton(container, "Inventory")).toHaveAttribute("aria-pressed", "true"); | ||
| expect( | ||
| screen.getByText("No artifact records were found in the manifest."), | ||
| ).toBeInTheDocument(); | ||
| expect( | ||
| screen.getByText("No intake diagnostics are available yet."), | ||
| ).toBeInTheDocument(); | ||
| expect(screen.getByText("No artifact detail was available.")).toBeInTheDocument(); | ||
| expect( | ||
| screen.getByText("No expected-evidence detail was recorded in the manifest."), | ||
| ).toBeInTheDocument(); | ||
|
|
||
| fireEvent.click(tabButton(container, "Notes")); | ||
| expect(tabButton(container, "Notes")).toHaveAttribute("aria-pressed", "true"); | ||
| expect(screen.getByText("Collector notes.")).toBeInTheDocument(); | ||
|
|
||
| fireEvent.click(tabButton(container, "Manifest")); | ||
| expect(tabButton(container, "Manifest")).toHaveAttribute("aria-pressed", "true"); | ||
| expect(screen.getByText('{"bundleId":"bundle-fixture"}')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("shows inspect error copy while keeping the dialog and tabs visible", async () => { | ||
| useLogStore.getState().setBundleMetadata(metadata()); | ||
| useLogStore.getState().setActiveSource({ | ||
| kind: "folder", | ||
| path: "/tmp/bundle", | ||
| }); | ||
| inspectEvidenceBundleMock.mockRejectedValue(new Error("inspect failed")); | ||
|
|
||
| const { container } = render(<EvidenceBundleDialog isOpen onClose={() => {}} />); | ||
|
|
||
| expect(await screen.findByText("inspect failed")).toBeInTheDocument(); | ||
| expect(container.querySelector('[role="dialog"]')).not.toBeNull(); | ||
| expect(tabButton(container, "Summary")).toBeTruthy(); | ||
| expect(tabButton(container, "Inventory")).toBeTruthy(); | ||
| expect(tabButton(container, "Notes")).toBeTruthy(); | ||
| expect(tabButton(container, "Manifest")).toBeTruthy(); | ||
|
|
||
| fireEvent.click(tabButton(container, "Notes")); | ||
| expect(screen.getByText("No content was available for this file.")).toBeInTheDocument(); | ||
| }); | ||
| }); |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { render, screen } from "@testing-library/react"; | ||
| import { describe, expect, it } from "vitest"; | ||
| import { FilterDialog } from "./FilterDialog"; | ||
|
|
||
| describe("FilterDialog", () => { | ||
| it("exposes a dialog landmark when open", () => { | ||
| render( | ||
| <FilterDialog | ||
| isOpen | ||
| onClose={() => {}} | ||
| onApply={async () => undefined} | ||
| currentClauses={[]} | ||
| />, | ||
| ); | ||
|
|
||
| const dialog = screen.getByRole("dialog", { name: "Filter" }); | ||
| expect(dialog).toHaveAttribute("aria-modal", "true"); | ||
| }); | ||
| }); |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.