Skip to content
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

Add fields tests for QPaper #16

Closed
Fibii opened this issue Jul 10, 2020 · 0 comments
Closed

Add fields tests for QPaper #16

Fibii opened this issue Jul 10, 2020 · 0 comments
Labels
enhancement New feature or request testing label for issues that are related to tests

Comments

@Fibii
Copy link
Owner

Fibii commented Jul 10, 2020

Description

QPaper.test.js doesn't have "rendered data tests", which lead to a logic error as shown in issue #14

what should be added

two checks must be added, preferably after line 35:

expect(getByTestId('title').textContent).toBe(question.title)
expect(parseInt(getByTestId('likes').textContent, 10)).toBe(utils.getLikes(question.likes)) 

aside from that, the mocked question has 0 likes, another question should be created, that contains likes, and the component will be tested again

possible fix

create a test called "renders QPaper" that asserts that the fields are rendered properly, with 2 different questions

@Fibii Fibii added enhancement New feature or request testing label for issues that are related to tests labels Jul 10, 2020
@Fibii Fibii closed this as completed Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing label for issues that are related to tests
Projects
None yet
Development

No branches or pull requests

1 participant