-
Notifications
You must be signed in to change notification settings - Fork 24
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
(PC-33638) feat(chronicle): add anchor on chronicle when see more button used #7602
Conversation
bb77c56
to
8929c99
Compare
src/features/chronicle/components/ChronicleCard/ChronicleCard.tsx
Outdated
Show resolved
Hide resolved
src/features/chronicle/components/ChronicleCardList/ChronicleCardListBase.tsx
Outdated
Show resolved
Hide resolved
9ae30df
to
2915313
Compare
2915313
to
d04439d
Compare
description={item.description} | ||
date={item.date} | ||
cardWidth={cardWidth}> | ||
{shouldShowSeeMoreButton && offerId ? ( |
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.
L'un ne va pas sans l'autre mais shouldShowSeeMoreButton est plus clair que si on avait juste offerId, qu'en pensez-vous ?
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.
Effectivement, si l'affichage de ton bouton dépend uniquement du fait d'avoir une offre, il n'y a aucune utilité à utiliser une autre propre pour faire la même chose. Mais est-ce que tu as vraiment besoin de ce test finalement ? Est-ce qu'on va avoir le cas où certaines chroniques auront des liens et pas d'autres ?
a9aa4f2
to
5f8054f
Compare
5f8054f
to
61fa669
Compare
@@ -12,7 +12,7 @@ const CHRONICLE_THUMBNAIL_SIZE = getSpacing(14) | |||
|
|||
type Props = ChronicleCardData & { | |||
cardWidth?: number | |||
} | |||
} & PropsWithChildren |
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.
Tu peux aussi écrire PropsWithChildren<ChronicleCardData & {...}>
description={item.description} | ||
date={item.date} | ||
cardWidth={cardWidth}> | ||
{shouldShowSeeMoreButton && offerId ? ( |
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.
Effectivement, si l'affichage de ton bouton dépend uniquement du fait d'avoir une offre, il n'y a aucune utilité à utiliser une autre propre pour faire la même chose. Mais est-ce que tu as vraiment besoin de ce test finalement ? Est-ce qu'on va avoir le cas où certaines chroniques auront des liens et pas d'autres ?
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.
Comme vu ensemble, dans le composant ChronicleCardListBase
plutôt exposer une prop onShowMore
optionnelle. si la prop est définie on sait qu'on doit afficher le bouton voir plus.
…ith only one prop onSeeMoreButtonPress
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
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.
Link to JIRA ticket: https://passculture.atlassian.net/browse/PC-33638
Flakiness
If I had to re-run tests in the CI due to flakiness, I add the incident on Notion
Checklist
I have:
Screenshots
iOS:
Enregistrement.de.l.ecran.2025-01-30.a.13.57.04.mov
Android :
Enregistrement.de.l.ecran.2025-01-30.a.14.00.42.mov
Web mobile :
Enregistrement.de.l.ecran.2025-01-30.a.13.55.30.mov
Web desktop :
Enregistrement.de.l.ecran.2025-01-30.a.13.56.16.mov
Best Practices
Click to expand
These rules apply to files that you make changes to. If you can't respect one of these rules, be sure to explain why with a comment. If you consider correcting the issue is too time consuming/complex: create a ticket. Link the ticket in the code.as
(type assertions are removed at compile-time, there is no runtime checking associated with a type assertion. There won’t be an exception ornull
generated if the type assertion is wrong). In certain casesas const
is acceptable (for example when defining readonly arrays/objects). Usingas
in tests is tolerable.any
(when you want to accept anything because you will be blindly passing it through without interacting with it, you can useunknown
). Usingany
in tests is tolerable.!
when you know that the value can’t benull
orundefined
).@ts-expect-error
and@eslint-disable
.yarn test:lint
,yarn test:types
,yarn start:web
...).gap
(ViewGap
) instead of<Spacer.Column />
,<Spacer.Row />
or<Spacer.Flex />
.Test specific:
user
tofireEvent
.setFeatureFlags
. If not possible, mention which one(s) you want to mock in a comment (example:jest.spyOn(useFeatureFlagAPI, 'useFeatureFlag').mockReturnValue(true) // WIP_NEW_OFFER_TILE in renderPassPlaylist.tsx
)await act(async () => {})
andawait waitFor(/* ... */)
byawait screen.findBySomething()
.act
by default andwaitFor
as a last resort.Advice: