Skip to content

Commit 00e4814

Browse files
authored
feat: add events additional info to all apps (#235)
1 parent 41d9715 commit 00e4814

6 files changed

Lines changed: 44 additions & 2 deletions

File tree

apps/hobbies-helsinki/src/domain/event/eventContent/EventContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const EventContent: React.FC<Props> = ({
6868
{description}
6969
</HtmlToReact>
7070
</div>
71-
{AppConfig.showEventLocationExtraInfo && locationExtraInfo && (
71+
{locationExtraInfo && (
7272
<>
7373
<h2 className={styles.descriptionTitle}>
7474
{t('event:locationExtraInfo.title')}

apps/hobbies-helsinki/src/domain/event/eventContent/__tests__/EventContent.test.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,23 @@ it('should hide map if internet event', () => {
111111
);
112112
expect(screen.queryByText(/sijainti/i)).not.toBeInTheDocument();
113113
});
114+
115+
it('should show location extra info when available', () => {
116+
render(
117+
<EventContent
118+
event={
119+
{
120+
...event,
121+
locationExtraInfo: { fi: 'Sisään takaovesta' },
122+
} as EventFieldsFragment
123+
}
124+
/>
125+
);
126+
expect(screen.getByText(/Paikan lisätiedot/i)).toBeInTheDocument();
127+
expect(screen.getByText(/Sisään takaovesta/i)).toBeInTheDocument();
128+
});
129+
130+
it('should not show location extra info title when location extra info not available', () => {
131+
render(<EventContent event={event} />);
132+
expect(screen.queryByText(/Paikan lisätiedot/i)).not.toBeInTheDocument();
133+
});

apps/hobbies-helsinki/src/domain/event/eventHero/__tests__/EventHero.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const getFakeEvent = (overrides?: Partial<EventDetails>) => {
4747
streetAddress: { fi: streetAddress },
4848
},
4949
externalLinks: [],
50+
locationExtraInfo: null,
5051
...overrides,
5152
}) as EventFieldsFragment;
5253
};

apps/sports-helsinki/src/domain/event/eventContent/EventContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const EventContent: React.FC<Props> = ({
6868
{description}
6969
</HtmlToReact>
7070
</div>
71-
{AppConfig.showEventLocationExtraInfo && locationExtraInfo && (
71+
{locationExtraInfo && (
7272
<>
7373
<h2 className={styles.descriptionTitle}>
7474
{t('event:locationExtraInfo.title')}

apps/sports-helsinki/src/domain/event/eventContent/__tests__/EventContent.test.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,23 @@ it('should hide map if internet event', () => {
111111
);
112112
expect(screen.queryByText(/sijainti/i)).not.toBeInTheDocument();
113113
});
114+
115+
it('should show location extra info when available', () => {
116+
render(
117+
<EventContent
118+
event={
119+
{
120+
...event,
121+
locationExtraInfo: { fi: 'Sisään takaovesta' },
122+
} as EventFieldsFragment
123+
}
124+
/>
125+
);
126+
expect(screen.getByText(/Paikan lisätiedot/i)).toBeInTheDocument();
127+
expect(screen.getByText(/Sisään takaovesta/i)).toBeInTheDocument();
128+
});
129+
130+
it('should not show location extra info title when location extra info not available', () => {
131+
render(<EventContent event={event} />);
132+
expect(screen.queryByText(/Paikan lisätiedot/i)).not.toBeInTheDocument();
133+
});

apps/sports-helsinki/src/domain/event/eventHero/__tests__/EventHero.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const getFakeEvent = (overrides?: Partial<EventDetails>) => {
4747
streetAddress: { fi: streetAddress },
4848
},
4949
externalLinks: [],
50+
locationExtraInfo: null,
5051
...overrides,
5152
}) as EventFieldsFragment;
5253
};

0 commit comments

Comments
 (0)