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

fix(LEMS-2082): update expression popover role and remove aria-checked #1371

Merged
merged 4 commits into from
Jun 25, 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
6 changes: 6 additions & 0 deletions .changeset/tidy-zebras-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@khanacademy/perseus": major
"@khanacademy/perseus-editor": major
---

update attributes for expression widget button
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ describe("expression-editor", () => {
jest.runOnlyPendingTimers();

await userEvent.click(
screen.getByRole("switch", {
screen.getByRole("button", {
name: "open math keypad",
}),
);
Expand Down
8 changes: 4 additions & 4 deletions packages/perseus/src/components/__tests__/math-input.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe("Perseus' MathInput", () => {
jest.runOnlyPendingTimers();

// Act
screen.getByRole("switch").click();
screen.getByRole("button").click();
await userEvent.click(screen.getByRole("button", {name: "1"}));
await userEvent.click(screen.getByRole("button", {name: "Plus"}));
await userEvent.click(screen.getByRole("button", {name: "2"}));
Expand Down Expand Up @@ -111,7 +111,7 @@ describe("Perseus' MathInput", () => {

// Act
// focusing the input triggers the popover
screen.getByRole("switch").click();
screen.getByRole("button").click();
await userEvent.click(screen.getByRole("button", {name: "1"}));
await userEvent.click(screen.getByRole("button", {name: "Plus"}));
await userEvent.click(screen.getByRole("button", {name: "2"}));
Expand All @@ -138,7 +138,7 @@ describe("Perseus' MathInput", () => {

// Act
// focusing the input triggers the popover
screen.getByRole("switch").click();
screen.getByRole("button").click();
await userEvent.click(screen.getByRole("button", {name: "1"}));

// Assert
Expand All @@ -160,7 +160,7 @@ describe("Perseus' MathInput", () => {

// Act
// focusing the input triggers the popover
screen.getByRole("switch").click();
screen.getByRole("button").click();
await userEvent.tab(); // to "123" tab
await userEvent.tab(); // to extra keys tab
await userEvent.tab(); // to whole keypad
Expand Down
3 changes: 1 addition & 2 deletions packages/perseus/src/components/math-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,7 @@ class InnerMathInput extends React.Component<InnerProps, State> {
? this.context.strings.closeKeypad
: this.context.strings.openKeypad
}
aria-checked={this.state.keypadOpen}
role="switch"
role="button"
onClick={() =>
this.state.keypadOpen
? this.closeKeypad()
Expand Down
Loading