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

Tests for get note by id #99

Merged
merged 12 commits into from
Nov 3, 2023
Merged

Tests for get note by id #99

merged 12 commits into from
Nov 3, 2023

Conversation

elizachi
Copy link
Contributor

Testcases were written for the get note by id method
New data for tests were added to the test database

New data for tests were added to the test database
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
@elizachi elizachi self-assigned this Oct 27, 2023
@elizachi elizachi requested a review from neSpecc October 28, 2023 17:23
url for a fake request define using the find method
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
fix implicit arrange
@elizachi elizachi requested a review from neSpecc October 30, 2023 22:57
Copy link
Member

@neSpecc neSpecc left a comment

Choose a reason for hiding this comment

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

We also need one more case:

  • Should return a Note when public access is disabled but user is creator

src/presentation/http/router/note.test.ts Show resolved Hide resolved
Need to decide what to do with the note creator.
@TatianaFomina
Copy link
Contributor

  • Should return a Note when public access is disabled but user is creator

I suggest adding such a testcase in a todo manner, because the ability to perform requests with authorization is not implemented yet and it seems like separate task

src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
@neSpecc
Copy link
Member

neSpecc commented Nov 2, 2023

I suggest adding such a testcase in a todo manner, because the ability to perform requests with authorization is not implemented yet and it seems like separate task

so lets add all left test cases with this manner

@elizachi
Copy link
Contributor Author

elizachi commented Nov 2, 2023

I suggest adding such a testcase in a todo manner, because the ability to perform requests with authorization is not implemented yet and it seems like separate task

so lets add all left test cases with this manner

I understand correctly that there should be the following @todo?

  • test case to handle invalid id's
  • test case with status 200, returning a note if it is not public, but the user is the author

@neSpecc
Copy link
Member

neSpecc commented Nov 2, 2023

I suggest adding such a testcase in a todo manner, because the ability to perform requests with authorization is not implemented yet and it seems like separate task

so lets add all left test cases with this manner

I understand correctly that there should be the following @todo?

  • test case to handle invalid id's
  • test case with status 200, returning a note if it is not public, but the user is the author

test for incorrect id should be implemented, since this logic already exists. The second one should be added with todo mark

src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
src/presentation/http/router/note.test.ts Outdated Show resolved Hide resolved
Removed 1 test case for 406
Copy link
Member

@neSpecc neSpecc left a comment

Choose a reason for hiding this comment

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

Perfect

@elizachi elizachi merged commit 563227e into main Nov 3, 2023
3 checks passed
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.

4 participants