Skip to content

Commit

Permalink
test(commandbox): update the expected calls to the request spy
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMcIntosh committed Feb 20, 2024
1 parent 0f80d4c commit 4e03a3e
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/components/ComboBox/ComboBox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,7 @@ describe("ComboBox", () => {
const commandButton = app.getByText("@workspace");
await user.click(commandButton);

expect(executableSpy).toHaveBeenLastCalledWith(
"@workspace ",
11,
"@workspace ",
);
expect(executableSpy).toHaveBeenLastCalledWith("@workspace ", 11, null);
});

test("execute command when pressing enter", async () => {
Expand All @@ -162,11 +158,7 @@ describe("ComboBox", () => {
);
const textarea = app.getByRole("combobox");
await user.type(textarea, "@wo{Enter}");
expect(executableSpy).toHaveBeenLastCalledWith(
"@workspace ",
11,
"@workspace ",
);
expect(executableSpy).toHaveBeenLastCalledWith("@workspace ", 11, null);
});

test("execute command when pressing tab", async () => {
Expand All @@ -176,11 +168,7 @@ describe("ComboBox", () => {
);
const textarea = app.getByRole("combobox");
await user.type(textarea, "@wo{Tab}");
expect(executableSpy).toHaveBeenLastCalledWith(
"@workspace ",
11,
"@workspace ",
);
expect(executableSpy).toHaveBeenLastCalledWith("@workspace ", 11, null);
});

test("typing executable command and pressing space", async () => {
Expand All @@ -190,11 +178,7 @@ describe("ComboBox", () => {
);
const textarea = app.getByRole("combobox");
await user.type(textarea, "@workspace{Space}");
expect(executableSpy).toHaveBeenLastCalledWith(
"@workspace ",
11,
"@workspace ",
);
expect(executableSpy).toHaveBeenLastCalledWith("@workspace ", 11, null);
});

test("submit when pressing enter", async () => {
Expand Down

0 comments on commit 4e03a3e

Please sign in to comment.