-
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-34196) feat(carousel): create custom carousel to replace carousel lib #7603
base: master
Are you sure you want to change the base?
Conversation
4328791
to
f08c2cc
Compare
8c34140
to
d02ca97
Compare
@@ -83,7 +83,8 @@ function renderOfferContent({ | |||
) | |||
} | |||
|
|||
describe('<OfferContent />', () => { | |||
// TODO(PC-34650) : react-native-web bump needed becasue of "setNativeProps is deprecated" warning making the test to fail | |||
describe.skip('<OfferContent />', () => { |
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.
eslint.disable ?
@@ -8,7 +8,8 @@ jest.mock('libs/firebase/remoteConfig/remoteConfig.services') | |||
|
|||
const mockOnPress = jest.fn() | |||
|
|||
describe('<OfferImageContainer />', () => { | |||
// TODO(PC-34650) : react-native-web bump needed becasue of "setNativeProps is deprecated" warning making the test to fail | |||
describe.skip('<OfferImageContainer />', () => { |
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.
eslint.disable ?
@@ -60,7 +60,8 @@ jest.mock('api/useSearchVenuesOffer/useSearchVenueOffers', () => ({ | |||
jest.mock('libs/firebase/analytics/analytics') | |||
jest.mock('libs/firebase/remoteConfig/remoteConfig.services') | |||
|
|||
describe('<Offer/>', () => { | |||
// TODO(PC-34650) : react-native-web bump needed becasue of "setNativeProps is deprecated" warning making the test to fail | |||
describe.skip('<Offer/>', () => { |
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.
eslint.disable ?
|
||
type CarouselProps = { | ||
data: unknown[] | ||
// We use any on purpose in this file |
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.
oui mais pourquoi ?
it('should not display pagination with dots and buttons', () => { | ||
render( | ||
<OfferImageCarouselPagination | ||
progressValue={{ value: 0 }} | ||
progressValue={PROGRESS_VALUE} | ||
offerImages={['image1', 'image2']} | ||
handlePressButton={jest.fn()} | ||
/> |
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.
Je ne comprends pas la pertinence de ce test, j'ai l'impression que l'on veut tester dans un test natif que l'on n'affiche pas le composant web ?
Ton premier test me semble suffisant 🙂
it('should not display pagination with only dots', () => { | ||
render( | ||
<OfferImageCarouselPagination | ||
progressValue={{ value: 0 }} | ||
progressValue={PROGRESS_VALUE} | ||
offerImages={['image1', 'image2']} | ||
handlePressButton={mockHandlePressButton} | ||
/> |
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.
Pareil ici, ce test semble vérifier que l'on affiche pas le composant natif, je pense que l'on peut s'en passer 🙂
const onViewableItemsChanged = ({ | ||
viewableItems, | ||
}: { | ||
changed: ViewToken[] |
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.
cette props ne semble plus être d'actualité 🙂
bounces={false} | ||
pagingEnabled | ||
viewabilityConfigCallbackPairs={ | ||
viewabilityConfigCallbackPairs.current as ViewabilityConfigCallbackPairs |
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.
j'ai l'impression que l'on peut se passer de as
🤔
data: unknown[] | ||
// We use any on purpose in this file | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
renderItem: ({ item, index }: { item: any; index: number }) => any |
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.
en utilisant les alias de types on peut pas enlever les "any" ?
d02ca97
to
544458b
Compare
Visit the preview URL for this PR (updated for commit 544458b): https://pc-native-testing--pr7603-pc-34196-replace-car-3p3y499k.web.app (expires Thu, 27 Feb 2025 13:02:14 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 54dd253190f9fbd3911a4f3fbe0f3af45c56e75f |
|
|
Link to JIRA ticket: https://passculture.atlassian.net/browse/PC-34196
Flakiness
If I had to re-run tests in the CI due to flakiness, I add the incident on Notion
Checklist
I have:
Screenshots
delete if no UI change
Simulator.Screen.Recording.-.iPhone.13.mini.-.2025-01-29.at.18.07.14.mp4
Enregistrement.de.l.ecran.2025-01-29.a.18.12.19.mov
Enregistrement.de.l.ecran.2025-01-29.a.18.09.59.mov
Enregistrement.de.l.ecran.2025-01-29.a.18.12.42.mov
Enregistrement.de.l.ecran.2025-01-29.a.18.09.22.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: