Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/pages/EventDetailPage/EventDetailPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ it("displays every page section and table row", async () => {
[
"About",
"Details",
"Registration",
"Additional Information",
"Tags",
"Date & Time",
"Event Link",
"View Details",
"Categories",
"Eligibilities",
"Age Group",
Expand Down
36 changes: 18 additions & 18 deletions app/pages/EventDetailPage/EventDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const EventDetailPage = () => {

const registrationRows = [
{
title: "Event Link",
title: "View Details",
value: data.registration_link?.url ? (
<a
href={data.registration_link.url}
Expand All @@ -83,9 +83,7 @@ export const EventDetailPage = () => {
>
{data.registration_link.url}
</a>
) : (
"No registration link available"
),
) : null,
},
];

Expand Down Expand Up @@ -156,20 +154,22 @@ export const EventDetailPage = () => {
/>
</DetailInfoSection>

<DetailInfoSection
title="Registration"
data-testid="eventdetailpage-detailinfosection"
>
<InfoTable<{ title: string; value: ReactNode }>
rowRenderer={(detail) => (
<tr key={detail.title}>
<th>{detail.title}</th>
<td>{detail.value}</td>
</tr>
)}
rows={registrationRows}
/>
</DetailInfoSection>
{data.registration_link?.url && (
<DetailInfoSection
title="Additional Information"
data-testid="eventdetailpage-detailinfosection"
>
<InfoTable<{ title: string; value: ReactNode }>
rowRenderer={(detail) => (
<tr key={detail.title}>
<th>{detail.title}</th>
<td>{detail.value}</td>
</tr>
)}
rows={registrationRows}
/>
</DetailInfoSection>
)}
<DetailInfoSection
title="Tags"
borderBottom={false}
Expand Down
2 changes: 1 addition & 1 deletion app/pages/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const CATEGORIES: Readonly<ServiceCategory[]> = [
{
algoliaCategoryName: "Education",
id: "358",
name: "Education",
name: "Education, After School, & Summer Programs",
slug: "education",
steps: ["subcategories", "results"],
subcategorySubheading: defaultSubheading,
Expand Down
8 changes: 8 additions & 0 deletions test/fixtures/EventsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export const EVENTS_DATA = [
{
data: {
id: 67,
registration_link: {
url: "https://www.our415.org",
},
attributes: {
title: "Back to School Conference",
createdAt: "2024-07-22T23:54:56.662Z",
Expand Down Expand Up @@ -1404,6 +1407,11 @@ export const createFormattedEventData = (): ReturnType<
typeof useEventData
>["data"] => ({
...EVENTS_DATA[0].data.attributes,
registration_link: {
id: EVENTS_DATA[0].data.id,
text: "Register",
url: EVENTS_DATA[0].data.registration_link?.url || "",
},
id: 10,
categories: [{ id: 11111, label: "Fake Label" }],
eligibilities: [{ id: 11111, label: "Fake Label" }],
Expand Down
Loading