-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing Resource Component #60
base: master
Are you sure you want to change the base?
Conversation
@@ -6,7 +6,11 @@ | |||
"@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.
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.
There was a problem hiding this 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" />); |
There was a problem hiding this comment.
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" />); |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
@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.