Skip to content

Commit b42e726

Browse files
committed
Refactor TaskCompletionStep tests for clarity and accuracy
- Updated test descriptions for better understanding. - Changed the test to check for the presence of a breadcrumb instead of a specific text. - Adjusted the button text assertion to reflect the new fixed status.
1 parent e8701f8 commit b42e726

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/components/TaskPane/ActiveTaskDetails/ActiveTaskControls/TaskCompletionStep/TaskCompletionStep.test.jsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { describe, expect, it } from "vitest";
22
import TaskCompletionStep from "./TaskCompletionStep";
33

44
describe("TaskCompletionStep", () => {
5-
it("renders task completion step 1 with required props", () => {
6-
const { getByText } = global.withProvider(
5+
it("renders task completion step with required props", () => {
6+
const { container } = global.withProvider(
77
<TaskCompletionStep
88
task={{}}
99
pickEditor={() => null}
@@ -15,13 +15,12 @@ describe("TaskCompletionStep", () => {
1515
deactivateKeyboardShortcutGroup={() => null}
1616
/>,
1717
);
18-
const text = getByText("Open Editor");
19-
expect(text).toBeInTheDocument();
18+
expect(container.querySelector(".breadcrumb")).toBeInTheDocument();
2019
});
2120

22-
it("shows Edit button if allowedProgressions includes 1", () => {
21+
it("shows fixed button if allowedProgressions includes fixed status", () => {
2322
const allowedProgressions = new Map();
24-
allowedProgressions.set(1);
23+
allowedProgressions.set(1, true);
2524

2625
const { getByText } = global.withProvider(
2726
<TaskCompletionStep
@@ -35,7 +34,7 @@ describe("TaskCompletionStep", () => {
3534
deactivateKeyboardShortcutGroup={() => null}
3635
/>,
3736
);
38-
const text = getByText("Open Editor");
37+
const text = getByText("I fixed it!");
3938
expect(text).toBeInTheDocument();
4039
});
4140
});

0 commit comments

Comments
 (0)