fix: address Task 4 review findings

This commit is contained in:
lda
2026-08-04 20:41:24 +07:00 Verified
parent ad3090e5be
commit 6a5af51813
11 changed files with 162 additions and 7 deletions
@@ -1,4 +1,5 @@
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { afterEach, describe, expect, it } from "vitest";
import { cleanup } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
@@ -57,4 +58,25 @@ describe("ConsoleShell", () => {
expect(screen.getByRole("link", { name: label })).toHaveAttribute("href", href);
}
});
it("provides a keyboard skip link to the workspace main region", async () => {
render(
<MemoryRouter>
<ConsoleShell
connection={initialState()}
onConnect={() => undefined}
onDraftChange={() => undefined}
>
<p>Content</p>
</ConsoleShell>
</MemoryRouter>,
);
const skipLink = screen.getByRole("link", { name: "Skip to main content" });
expect(skipLink).toHaveAttribute("href", "#console-workspace-main");
await userEvent.tab();
expect(skipLink).toHaveFocus();
});
});