Skip to content
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

feat: validate output HTML #2475

Merged
merged 7 commits into from
Sep 19, 2024
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 examples/Input.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function textbox() {
}

function gridcells() {
return screen.queryAllByRole("gridcell") as HTMLTableCellElement[];
return screen.queryAllByRole("cell") as HTMLTableCellElement[];
}

function selectedCells() {
Expand Down
2 changes: 1 addition & 1 deletion examples/ModifiersHidden.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ afterAll(() => jest.useRealTimers());
test.each(days)("the day %s should be hidden", (day) => {
render(<ModifiersHidden />);
expect(
screen.queryByRole("gridcell", { name: `${day.getDate()}` })
screen.queryByRole("cell", { name: `${day.getDate()}` })
).not.toBeInTheDocument();
});
2 changes: 1 addition & 1 deletion examples/Range.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe("when a day in the range is clicked", () => {
});

function getAllSelected() {
const gridcells = screen.getAllByRole("gridcell");
const gridcells = screen.getAllByRole("cell");

return Array.from(gridcells).filter(
(gridcell) => gridcell.getAttribute("aria-selected") === "true"
Expand Down
4 changes: 2 additions & 2 deletions examples/Weeknumber.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const today = new Date(2021, 10, 25);
beforeAll(() => jest.setSystemTime(today));
afterAll(() => jest.useRealTimers());

function getWeekButton(week: number) {
function getWeek(week: number) {
return screen.getByRole("rowheader", {
name: `Week ${week}`
});
Expand All @@ -19,6 +19,6 @@ beforeEach(() => render(<Weeknumber />).container);

describe("when displaying November 2021", () => {
test("should display the 45th week number", () => {
expect(getWeekButton(45)).toBeInTheDocument();
expect(getWeek(45)).toBeInTheDocument();
});
});
4 changes: 2 additions & 2 deletions examples/WeeknumberCustom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export function WeeknumberCustom() {
defaultMonth={addMonths(today, -1)}
components={{
WeekNumber: ({ week, ...props }: WeekNumberProps) => (
<td {...props}>
<th {...props}>
<button onClick={() => console.log(week)}>{props.children}</button>
</td>
</th>
)
}}
labels={{
Expand Down
Loading