Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/app/src/features/projects/detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function ProjectDetail() {
const { projectId } = useParams({ from: "/projects/$projectId" });
const project = useQuery(projectQuery(projectId));
const [view, setView] = useState<"list" | "graph">("list");
return <ProjectNav tab="jobs">{project.data && <div className="mb-5 flex flex-wrap items-center justify-end gap-3">
return <ProjectNav tab="jobs">{project.data && <div className="mb-5 flex flex-wrap items-center justify-between gap-3">
<div role="group" aria-label="Project jobs view" className="inline-flex rounded-lg border border-stone-200 bg-white p-0.5 dark:border-slate-700 dark:bg-slate-900">
<Button className={`min-h-9 rounded-md border-0 px-3 py-1.5 ${view === "list" ? "bg-stone-100 text-slate-950 shadow-sm dark:bg-slate-800 dark:text-white" : "bg-transparent text-slate-600 hover:bg-stone-50 dark:text-slate-300 dark:hover:bg-slate-800"}`} aria-pressed={view === "list"} onClick={() => setView("list")}>List</Button>
<Button className={`min-h-9 rounded-md border-0 px-3 py-1.5 ${view === "graph" ? "bg-stone-100 text-slate-950 shadow-sm dark:bg-slate-800 dark:text-white" : "bg-transparent text-slate-600 hover:bg-stone-50 dark:text-slate-300 dark:hover:bg-slate-800"}`} aria-pressed={view === "graph"} onClick={() => setView("graph")}>Graph</Button>
Expand Down
Binary file modified packages/app/test/visual/baselines/project-jobs-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion packages/app/test/visual/design.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,15 @@ for (const [label, width, height] of [["desktop", 1721, 914], ["mobile", 390, 84
await expect(page.getByRole("heading", { name: "Project" })).toHaveCount(0);
await expect(page.getByRole("button", { name: "List", exact: true })).toHaveAttribute("aria-pressed", "true");
await expect(page.getByRole("button", { name: "Graph", exact: true })).toHaveAttribute("aria-pressed", "false");
await expect(page.getByRole("link", { name: "Create job" })).toHaveAttribute("href", "/jobs/new?projectId=" + projectId);
const viewGroup = page.getByRole("group", { name: "Project jobs view" });
const actionRow = viewGroup.locator("..");
const viewBox = await viewGroup.boundingBox();
const actionRowBox = await actionRow.boundingBox();
const createJob = page.getByRole("link", { name: "Create job" });
const createJobBox = await createJob.boundingBox();
expect(Math.abs(viewBox.x - actionRowBox.x)).toBeLessThan(2);
expect(Math.abs(createJobBox.x + createJobBox.width - actionRowBox.x - actionRowBox.width)).toBeLessThan(2);
await expect(createJob).toHaveAttribute("href", "/jobs/new?projectId=" + projectId);
await expect(page.getByRole("table", { name: "Jobs" })).toBeVisible();
await page.getByRole("button", { name: "Graph", exact: true }).click();
await expect(page.getByRole("button", { name: "Graph", exact: true })).toHaveAttribute("aria-pressed", "true");
Expand Down
Loading