fix: make prepared input manifest claims factual
This commit is contained in:
@@ -5,7 +5,7 @@ import { RunInputFileBrowser } from "./RunInputFileBrowser.js";
|
|||||||
afterEach(() => cleanup());
|
afterEach(() => cleanup());
|
||||||
|
|
||||||
describe("RunInputFileBrowser", () => {
|
describe("RunInputFileBrowser", () => {
|
||||||
it("renders the selected docs paths as factual readable files", () => {
|
it("renders included docs paths as factual prepared-run files", () => {
|
||||||
render(
|
render(
|
||||||
<RunInputFileBrowser
|
<RunInputFileBrowser
|
||||||
selectedDocuments={["docs/project-brief.md", "docs/architecture-notes.md"]}
|
selectedDocuments={["docs/project-brief.md", "docs/architecture-notes.md"]}
|
||||||
@@ -16,13 +16,16 @@ describe("RunInputFileBrowser", () => {
|
|||||||
const browser = screen.getByRole("region", { name: /workflow input files/i });
|
const browser = screen.getByRole("region", { name: /workflow input files/i });
|
||||||
expect(within(browser).getByRole("heading", { name: "docs/" })).toBeInTheDocument();
|
expect(within(browser).getByRole("heading", { name: "docs/" })).toBeInTheDocument();
|
||||||
|
|
||||||
const files = within(browser).getByRole("list", { name: /selected for this run/i });
|
const files = within(browser).getByRole("list", { name: /included in prepared run/i });
|
||||||
expect(within(files).getAllByRole("listitem")).toHaveLength(2);
|
expect(within(files).getAllByRole("listitem")).toHaveLength(2);
|
||||||
|
expect(within(files).getAllByText(/included in prepared run/i)).toHaveLength(2);
|
||||||
|
expect(within(files).queryAllByRole("button")).toHaveLength(0);
|
||||||
|
expect(within(files).queryAllByRole("link")).toHaveLength(0);
|
||||||
for (const path of ["docs/project-brief.md", "docs/architecture-notes.md"]) {
|
for (const path of ["docs/project-brief.md", "docs/architecture-notes.md"]) {
|
||||||
const row = within(files).getByText(path).closest("li");
|
const row = within(files).getByText(path).closest("li");
|
||||||
expect(row).not.toBeNull();
|
expect(row).not.toBeNull();
|
||||||
expect(row).toHaveAttribute("data-file-path", path);
|
expect(row).toHaveAttribute("data-file-path", path);
|
||||||
expect(row).toHaveTextContent(/selected|read/i);
|
expect(row).toHaveTextContent(/included in prepared run/i);
|
||||||
}
|
}
|
||||||
|
|
||||||
const destination = within(browser).getByRole("group", { name: /workflow output/i });
|
const destination = within(browser).getByRole("group", { name: /workflow output/i });
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ export const RunInputFileBrowser = ({
|
|||||||
<section className="run-input-file-browser" role="region" aria-label="workflow input files">
|
<section className="run-input-file-browser" role="region" aria-label="workflow input files">
|
||||||
<header className="run-input-file-browser__header">
|
<header className="run-input-file-browser__header">
|
||||||
<h3>docs/</h3>
|
<h3>docs/</h3>
|
||||||
<span>selected for this run</span>
|
<span>included in prepared run</span>
|
||||||
</header>
|
</header>
|
||||||
<ul className="run-input-file-browser__list" aria-label="selected for this run">
|
<ul className="run-input-file-browser__list" aria-label="included in prepared run">
|
||||||
{selectedDocuments.map((path) => (
|
{selectedDocuments.map((path) => (
|
||||||
<li className="run-input-file-browser__file" data-file-path={path} key={path}>
|
<li className="run-input-file-browser__file" data-file-path={path} key={path}>
|
||||||
<span className="run-input-file-browser__icon" aria-hidden="true">file</span>
|
<span className="run-input-file-browser__icon" aria-hidden="true">file</span>
|
||||||
<code>{path}</code>
|
<code>{path}</code>
|
||||||
<span className="run-input-file-browser__marker">selected / read</span>
|
<span className="run-input-file-browser__marker">included in prepared run</span>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user