Skip to content

Conversation

IngridFuentes
Copy link
Contributor

I created unit cases to test the Resource component. I tested the Toggle render, unit case for the resource name, and the render for the resource body.

"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you had a merge conflict here which inserts these lines. You will need to remove them - lines 9, 11 and 13. I believe this pull request build is failing because of it.

Copy link
Contributor

@sunithapatel sunithapatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IngridFuentes This is a great start to getting some tests in here! There is one thing to fix to fix the build for this pull request, and I think some work is needed to make sure you are testing the correct thing.

})

test("resource name", () => {
render(<div data-testid="name" />);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little confused why you are rendering a div in this test. I would think you would need to render the Resource component itself?

// screen.debug();

test("resource body", () => {
render(<div data-testid="body" />);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here. I would think you would have to render the Resource component first and then just have the lines to get the resourceBody here and verify it is there.

});


// const { getByText } = render(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove all the commented out code from here?

@sunithapatel
Copy link
Contributor

@IngridFuentes checking if you would be able to work on this to resolve these issues? If not, it's no problem, just let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants