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

Issue #100: Update unit testing for the listing class #101

Merged

Conversation

AzizulHakim96
Copy link
Collaborator

@AzizulHakim96 AzizulHakim96 commented Feb 26, 2021

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

@AzizulHakim96 AzizulHakim96 added backend Backend related tasks database Database related tasks testing testing related tasks Dev-task labels Feb 26, 2021
@AzizulHakim96 AzizulHakim96 added this to the Sprint 2 milestone Feb 26, 2021
@AzizulHakim96 AzizulHakim96 self-assigned this Feb 26, 2021
@AzizulHakim96 AzizulHakim96 added this to Under Review in Rentr via automation Feb 26, 2021
@AzizulHakim96 AzizulHakim96 linked an issue Feb 26, 2021 that may be closed by this pull request
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);
});
});
Copy link
Owner

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.

@jcsnorlax97 jcsnorlax97 changed the title Issue #100 updating tests for the listing class Issue #100: Update unit testing for the listing class Feb 26, 2021
Rentr automation moved this from Under Review to Review Approved Feb 26, 2021
@AzizulHakim96 AzizulHakim96 merged commit 4d7f7e8 into develop Feb 26, 2021
Rentr automation moved this from Review Approved to Done Feb 26, 2021
@jcsnorlax97 jcsnorlax97 deleted the issue-#100--Updating-tests-for-the-listing-class branch February 26, 2021 22:44
@jcsnorlax97 jcsnorlax97 added the High Priority Task with high priority label Feb 26, 2021
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
Projects
Rentr
Done
Development

Successfully merging this pull request may close these issues.

[TASK] Story #23: Update unit testing for listing class
4 participants