Skip to content

Commit

Permalink
[FEI-5533-part1] Use Capital case Escape to match key constants
Browse files Browse the repository at this point in the history
  • Loading branch information
marcysutton committed Jan 17, 2025
1 parent aa8c34f commit 2ada9bd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,14 @@ describe("SingleSelect", () => {
expect(onChange).not.toHaveBeenCalled();
});

it("should dismiss the dropdown when pressing {escape}", async () => {
it("should dismiss the dropdown when pressing {Escape}", async () => {
// Arrange
const {userEvent} = doRender(uncontrolledSingleSelect);
await userEvent.tab();
await userEvent.keyboard("{Enter}"); // open

// Act
await userEvent.keyboard("{escape}");
await userEvent.keyboard("{Escape}");

// Assert
expect(onChange).not.toHaveBeenCalled();
Expand Down Expand Up @@ -2300,7 +2300,7 @@ describe("SingleSelect", () => {
// Act
await userEvent.tab();
await userEvent.keyboard("{Enter}"); // Open the dropdown
await userEvent.keyboard("{escape}"); // Close the dropdown
await userEvent.keyboard("{Escape}"); // Close the dropdown

// Assert
expect(onValidate).toHaveBeenCalledExactlyOnceWith(
Expand All @@ -2318,7 +2318,7 @@ describe("SingleSelect", () => {
// Act
await userEvent.tab();
await userEvent.keyboard("{Enter}"); // Open the dropdown
await userEvent.keyboard("{escape}"); // Close the dropdown
await userEvent.keyboard("{Escape}"); // Close the dropdown

// Assert
expect(await screen.findByRole("button")).toHaveAttribute(
Expand Down

0 comments on commit 2ada9bd

Please sign in to comment.