Testing Resource Component#60
Testing Resource Component#60IngridFuentes wants to merge 3 commits intofrontendstudygroup:masterfrom
Conversation
| "@testing-library/jest-dom": "^5.14.1", | ||
| "@testing-library/react": "^11.2.7", | ||
| "@testing-library/user-event": "^12.8.3", | ||
| <<<<<<< HEAD |
There was a problem hiding this comment.
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.
sunithapatel
left a comment
There was a problem hiding this comment.
@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" />); |
There was a problem hiding this comment.
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" />); |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Can you remove all the commented out code from here?
|
@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. |
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.