-
Notifications
You must be signed in to change notification settings - Fork 2
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
Issue #100: Update unit testing for the listing class #101
Merged
AzizulHakim96
merged 3 commits into
develop
from
issue-#100--Updating-tests-for-the-listing-class
Feb 26, 2021
Merged
Issue #100: Update unit testing for the listing class #101
AzizulHakim96
merged 3 commits into
develop
from
issue-#100--Updating-tests-for-the-listing-class
Feb 26, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ssue64-Task-GetRouteForSingleListing
Mik3Qiao
approved these changes
Feb 26, 2021
jcsnorlax97
approved these changes
Feb 26, 2021
Comment on lines
+104
to
+122
|
||
describe('getListingViaId failed due to listing not found (404)', () => { | ||
// GIVEN | ||
const listing = null; | ||
const listingDao = { | ||
getListingViaId: (_) => listing, | ||
}; | ||
const listingService = new ListingService({ listingDao }); | ||
// invalid id which is not present | ||
const id = 100; | ||
|
||
it('404', () => { | ||
// WHEN | ||
const result = listingService.getListingViaId(id); | ||
|
||
// THEN | ||
expect(result).toEqual(null); | ||
}); | ||
}); |
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 good to me! It is a good idea to use a nested describe
keyword to show different test paths.
NathanCarriere
approved these changes
Feb 26, 2021
Closed
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend
Backend related tasks
database
Database related tasks
Dev-task
High Priority
Task with high priority
testing
testing related tasks
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Associated issues:
User story: #23
dev task: #100
Task Description:
This ticket aims to add a new test(listing not found when Id is invalid) in the listing.test.js class.
GitHub Action
closes #100
Test passes!
![newtestAdded](https://user-images.githubusercontent.com/56322456/109269279-e774e500-77d1-11eb-837e-c179ead88182.JPG)