-
Notifications
You must be signed in to change notification settings - Fork 400
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
Include Add-on name and Add-on Icon in each review under "My reviews" on User Profile #12426
base: master
Are you sure you want to change the base?
Conversation
…ser Profile This change conditionally renders the add-on's name and icon when viewing a review on the User Profile page. This reduces redundancy on the Add-on Reviews page, ensuring that the add-on name and icon are only displayed where it adds value and clarity.
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master mozilla/addons-frontend#12426 +/- ##
=======================================
Coverage 98.50% 98.50%
=======================================
Files 258 258
Lines 10177 10189 +12
Branches 3060 3071 +11
=======================================
+ Hits 10025 10037 +12
Misses 144 144
Partials 8 8
☔ View full report in Codecov by Sentry. |
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.
There's a UX mockup in the issue - https://github.com/mozilla/addons-frontend/issues/5858#issuecomment-417794798 - can we have it look like that?
Sure, I will be pushing changes per the UX mockup tomorrow. |
We need a test in TestAddonReviewCard that checks this extra markup is displayed when |
It looks a little weird with the icon outside like that. IMHO the icon should be left-aligned with the stars and text on that page. |
This commit enhances the localization support of the addon's name within reviews by ensuring the user's current locale is taken into consideration.
src/amo/actions/reviews.js
Outdated
): UserReviewType { | ||
const effectiveLang = lang || 'en-US'; |
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.
tests in amo/reducers/test_reviews.js fail invariant checks without this line.
in analogous tests, calls to selectLocalizedContent
are made by functions such as createInternalAddonWithLang that call createInternalAddon
with lang
set to DEFAULT_LANG_IN_TESTS
.
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.
We need an equivalent function (e.g. createInternalReviewWithLang
) that does a similar thing, and then change the calls in the tests in reducers/test_reviews.js
to use that utility function.
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.
I tried a lot of different approaches with createInternalReview
changed to createInternalReviewWithLang
. There are many different test files which use createInternalReview
, and the number of invariant checks failing substantially increase.
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.
just some fixes with the tests
src/amo/actions/reviews.js
Outdated
): UserReviewType { | ||
const effectiveLang = lang || 'en-US'; |
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.
We need an equivalent function (e.g. createInternalReviewWithLang
) that does a similar thing, and then change the calls in the tests in reducers/test_reviews.js
to use that utility function.
there are some As discussed with @eviljeff, this may be due to some of the existing tests not having the correct setup. |
I assume that some of the existing tests don't have the correct setup. The fix should otherwise be ready to merge. I will move on to other bugs. |
e3409a1 reduces the failing tests to 6. |
@shribyte could you look at the last failing tests ? |
@diox I looked at it some time back and couldn't exactly figure out why some existing tests were failing despite the Will look into it again after I'm done with my current assigned bugs. |
Fixes mozilla/addons#2050
This patch includes the Add-on Name and Add-on Icon in each review under "My reviews", on the User Profile.
Before:
After: