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
4 changes: 3 additions & 1 deletion e2e/stories-a11y.known.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
"primitives-csv-table--resized-column (dark): color-contrast-unmeasured": "The selected range's outline is one box laid over its cells that paints only a border; hit-testing finds that box over the selected text and the sampler cannot follow a box that paints its edges alone, so the ground under the selected cells cannot be read.",
"primitives-csv-table--resized-column (light): color-contrast-unmeasured": "The selected range's outline is one box laid over its cells that paints only a border; hit-testing finds that box over the selected text and the sampler cannot follow a box that paints its edges alone, so the ground under the selected cells cannot be read.",
"primitives-csv-table--selection (dark): color-contrast-unmeasured": "The selected range's outline is one box laid over its cells that paints only a border; hit-testing finds that box over the selected text and the sampler cannot follow a box that paints its edges alone, so the ground under the selected cells cannot be read.",
"primitives-csv-table--selection (light): color-contrast-unmeasured": "The selected range's outline is one box laid over its cells that paints only a border; hit-testing finds that box over the selected text and the sampler cannot follow a box that paints its edges alone, so the ground under the selected cells cannot be read."
"primitives-csv-table--selection (light): color-contrast-unmeasured": "The selected range's outline is one box laid over its cells that paints only a border; hit-testing finds that box over the selected text and the sampler cannot follow a box that paints its edges alone, so the ground under the selected cells cannot be read.",
"primitives-csv-table--sheets (dark): color-contrast-unmeasured": "The selected range's outline is one box laid over its cells that paints only a border; hit-testing finds that box over the selected text and the sampler cannot follow a box that paints its edges alone, so the ground under the selected cells cannot be read.",
"primitives-csv-table--sheets (light): color-contrast-unmeasured": "The selected range's outline is one box laid over its cells that paints only a border; hit-testing finds that box over the selected text and the sampler cannot follow a box that paints its edges alone, so the ground under the selected cells cannot be read."
}
23 changes: 23 additions & 0 deletions src/ui/csv-table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,27 @@ describe("CsvTable interactive", () => {
expect(selections.at(-1)).toBeNull();
unmount();
});

test("arrow keys move between sheet tabs and open the sheet", () => {
const { container, firstColumn, unmount } = mount({
interactive: true,
sheets: [
{ name: "One", text: "name,n\na,1\nb,2" },
{ name: "Two", text: "name,n\nz,9\ny,8" },
],
});
const tabs = () => [...container.querySelectorAll('[role="tab"]')];
act(() => {
tabs()[0]?.dispatchEvent(
new KeyboardEvent("keydown", { key: "ArrowRight", bubbles: true }),
);
});
expect(tabs().map((tab) => tab.getAttribute("aria-selected"))).toEqual([
"false",
"true",
]);
expect(document.activeElement).toBe(tabs()[1] ?? null);
expect(firstColumn()).toEqual(["z", "y"]);
unmount();
});
});
Loading
Loading