michael-fesselmeyer / ember-super-rentals

1 stars 0 forks source link

Feat/rentalrating #25

Closed michael-fesselmeyer closed 1 year ago

michael-fesselmeyer commented 1 year ago

Summary This pull request introduces the RentalRating component and integrates it into the rental property template. The RentalRating component allows users to upvote or downvote a rental property, and the component's state updates accordingly. The PR also includes tests for the new component and updates to the Prettier configuration to avoid inaccurate linting errors.

My goal with this component was to demonstrate my ability to understand state changes in Ember since I have just begun learning it but do have knowledge of state changing due to my experience with the React framework. This is also one of my first attempts to write a unit test for a component with no guide to follow and am having some issues getting the test to work the way I want it even though everything works fine on the website.

Changes New Features Generated the RentalRating component using Ember's component generator. Added initial state to RentalRating component. Added upvote and downvote actions to RentalRating component. Integrated RentalRating component into the rental property template.

Fixes Updated the RentalRating component to prevent the score from exceeding 1. Updated the rental-rating-test.js file to add a space after function declarations, in line with the project's style guide.

Tests Updated the rental-rating-test.js file to include tests that check the RentalRating component's score updates correctly when the upvote and downvote actions are triggered. Made further updates to the rental-rating-test.js file in an attempt to fix failing tests. Configuration Updated the Prettier configuration files to avoid inaccurate linting errors.

Request for Review I would appreciate a review of the changes made in this PR, particularly the RentalRating component and the tests I made for it. Any feedback on the component's functionality, the tests, or the Prettier configuration changes would be greatly appreciated.

Thanks Jordan