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
5 changes: 5 additions & 0 deletions .changeset/hungry-brooms-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus-editor": patch
---

[Interactive Graph] Handle autogen aria label for open locked points
Original file line number Diff line number Diff line change
Expand Up @@ -491,4 +491,33 @@ describe("LockedPointSettings", () => {
"Point spoken A, spoken B at spoken $0$ comma spoken $0$. Appearance solid gray.",
});
});

test("aria label does not include fill when filled is false", async () => {
// Arrange
const onChangeProps = jest.fn();

// Act
render(
<LockedPointSettings
{...defaultProps}
ariaLabel={undefined}
onChangeProps={onChangeProps}
filled={false}
/>,
{wrapper: RenderStateRoot},
);

const autoGenButton = screen.getByRole("button", {
name: "Auto-generate",
});
await userEvent.click(autoGenButton);

// Assert
// generateSpokenMathDetails is mocked to return the input string
// with "Spoken math details for " prepended.
expect(onChangeProps).toHaveBeenCalledWith({
ariaLabel:
"Point at spoken $0$ comma spoken $0$. Appearance solid gray border, with no fill.",
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ const LockedPointSettings = (props: Props) => {

let str = `Point${visiblelabel} at ${spokenX} comma ${spokenY}`;

const pointAppearance =
generateLockedFigureAppearanceDescription(pointColor);
const pointAppearance = generateLockedFigureAppearanceDescription(
pointColor,
"solid",
filled ? undefined : "none",
);
str += pointAppearance;

return str;
Expand Down
Loading