Skip to content

Commit

Permalink
(PC-32105) feat(offer): change venue button icon (#7655)
Browse files Browse the repository at this point in the history
  • Loading branch information
clesausse-pass authored Feb 10, 2025
1 parent 1d9ec6b commit 5f47170
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { OfferVenueResponse } from 'api/gen'
import { OfferVenueButton } from 'features/offer/components/OfferVenueButton/OfferVenueButton'
import { offerResponseSnap } from 'features/offer/fixtures/offerResponse'
import { analytics } from 'libs/analytics/provider'
import { fireEvent, render, screen, waitFor } from 'tests/utils'
import { render, screen, userEvent } from 'tests/utils'

const user = userEvent.setup()

jest.useFakeTimers()

describe('<OfferVenueButton />', () => {
it('should display public name when informed', () => {
Expand Down Expand Up @@ -63,17 +67,15 @@ describe('<OfferVenueButton />', () => {
it('should redirect to venue page when pressing button', async () => {
render(<OfferVenueButton venue={offerResponseSnap.venue} />)

fireEvent.press(screen.getByTestId('Accéder à la page du lieu PATHE BEAUGRENELLE'))
await user.press(screen.getByTestId('Accéder à la page du lieu PATHE BEAUGRENELLE'))

await waitFor(() =>
expect(navigate).toHaveBeenCalledWith('Venue', { id: offerResponseSnap.venue.id })
)
expect(navigate).toHaveBeenCalledWith('Venue', { id: offerResponseSnap.venue.id })
})

it('should track the venue redirection when the pressing button', () => {
it('should track the venue redirection when the pressing button', async () => {
render(<OfferVenueButton venue={offerResponseSnap.venue} />)

fireEvent.press(screen.getByTestId('Accéder à la page du lieu PATHE BEAUGRENELLE'))
await user.press(screen.getByTestId('Accéder à la page du lieu PATHE BEAUGRENELLE'))

expect(analytics.logConsultVenue).toHaveBeenCalledWith({
venueId: offerResponseSnap.venue.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components/native'
import { OfferVenueResponse } from 'api/gen'
import { analytics } from 'libs/analytics/provider'
import { HeroButtonList } from 'ui/components/buttons/HeroButtonList'
import { LocationPointer } from 'ui/svg/icons/LocationPointer'
import { LocationBuildingFilled } from 'ui/svg/icons/LocationBuildingFilled'
import { TypoDS } from 'ui/theme'

interface Props {
Expand All @@ -22,7 +22,7 @@ export function OfferVenueButton({ venue }: Readonly<Props>) {
Subtitle={
venue.city ? <SubtitleText testID="subtitle">{venue.city}</SubtitleText> : undefined
}
Icon={<LocationPointer color={theme.colors.black} size={theme.icons.sizes.small} />}
Icon={<LocationBuildingFilled color={theme.colors.black} size={theme.icons.sizes.small} />}
navigateTo={{ screen: 'Venue', params: { id: venue.id } }}
onBeforeNavigate={() => analytics.logConsultVenue({ venueId: venue.id, from: 'offer' })}
accessibilityLabel={`Accéder à la page du lieu ${venueName}`}
Expand Down

0 comments on commit 5f47170

Please sign in to comment.