Skip to content

Commit 675e2c6

Browse files
author
喜喜懒羊羊
committed
fix error in addwbs file
1 parent ffc8ef5 commit 675e2c6

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/Projects/WBS/AddWBS/AddWBS.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const AddWBS = props => {
4949
className="btn btn-outline-primary"
5050
type="button"
5151
onClick={handleAddWBS}
52+
data-testid="add-wbs-button"
5253
>
5354
<i className="fa fa-plus" aria-hidden="true"></i>
5455
</button>

src/components/Projects/WBS/AddWBS/__tests__/AddWBS.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe("AddWBS component structure", () => {
6666
});
6767

6868
test("button should not be in the document when the input field is empty", () => {
69-
expect(screen.queryByRole('button')).toBeNull();
69+
expect(screen.queryByTestId('add-wbs-button')).toBeNull();
7070
});
7171

7272
test("user should be able to type in the input field", () => {
@@ -76,7 +76,7 @@ describe("AddWBS component structure", () => {
7676

7777
test("button should appear when user types in the input field", () => {
7878
typeIntoInput({ input: '123' });
79-
expect(screen.queryByRole('button')).not.toBeNull();
79+
expect(screen.queryByTestId('add-wbs-button')).not.toBeNull();
8080
});
8181
});
8282

0 commit comments

Comments
 (0)