diff --git a/additional.d.ts b/additional.d.ts index 620e04da0..dc6917c89 100644 --- a/additional.d.ts +++ b/additional.d.ts @@ -1,36 +1,35 @@ /// +declare module 'nock' +declare module 'test-utils' +declare module '@testing-library/react' declare module '@department-of-veterans-affairs/component-library' +declare module '@department-of-veterans-affairs/component-library/Table' +declare module '@department-of-veterans-affairs/component-library/LoadingIndicator' declare module '@department-of-veterans-affairs/component-library/AlertBox' -declare module '@department-of-veterans-affairs/component-library/Banner' -declare module '@department-of-veterans-affairs/component-library/Breadcrumbs' -declare module '@department-of-veterans-affairs/component-library/dist/react-bindings' declare module '@department-of-veterans-affairs/component-library/DropDownPanel' -declare module '@department-of-veterans-affairs/component-library/LoadingIndicator' +declare module '@department-of-veterans-affairs/component-library/Breadcrumbs' +declare module '@department-of-veterans-affairs/component-library/Banner' +declare module '@department-of-veterans-affairs/component-library/TextInput' +declare module '@department-of-veterans-affairs/component-library/TextArea' declare module '@department-of-veterans-affairs/component-library/Modal' declare module '@department-of-veterans-affairs/component-library/Pagination' declare module '@department-of-veterans-affairs/component-library/ProgressButton' declare module '@department-of-veterans-affairs/component-library/PromoBanner' -declare module '@department-of-veterans-affairs/component-library/Table' -declare module '@department-of-veterans-affairs/component-library/TextArea' -declare module '@department-of-veterans-affairs/component-library/TextInput' -declare module '@testing-library/react' -declare module 'debug' +declare module '@department-of-veterans-affairs/component-library/dist/react-bindings' declare module 'mq-polyfill' -declare module 'nock' -declare module 'test-utils' +declare module 'debug' declare namespace JSX { interface IntrinsicElements { - 'va-accordion-item' - 'va-accordion' 'va-alert' - 'va-back-to-top' - 'va-breadcrumbs' - 'va-button' - 'va-icon' 'va-link' - 'va-link-action' + 'va-icon' + 'va-button' + 'va-breadcrumbs' + 'va-accordion' + 'va-accordion-item' 'va-on-this-page' + 'va-back-to-top' } } diff --git a/src/lib/utils/events.test.ts b/src/lib/utils/events.test.ts index cc90b3e93..662594d2f 100644 --- a/src/lib/utils/events.test.ts +++ b/src/lib/utils/events.test.ts @@ -2,13 +2,6 @@ import { formatEventCTA, createMailToLink } from './events' describe('formatEventCTA', () => { describe('formatEventCTA', () => { - it('should format "rsvp" as "RSVP"', () => { - const input = 'rsvp' - const expected = 'RSVP' - const result = formatEventCTA(input) - expect(result).toBe(expected) - }) - it('should format "register_now" as "Register now"', () => { const input = 'register_now' const expected = 'Register now' diff --git a/src/lib/utils/events.ts b/src/lib/utils/events.ts index cd33ddfbf..b7f58463f 100644 --- a/src/lib/utils/events.ts +++ b/src/lib/utils/events.ts @@ -1,10 +1,6 @@ import { deriveFormattedTimestamp } from './date' export function formatEventCTA(input: string): string { - if (input.toLowerCase() === 'rsvp') { - return 'RSVP' - } - const words: string[] = input.split('_') const formattedString: string = words diff --git a/src/templates/layouts/event/index.tsx b/src/templates/layouts/event/index.tsx index f854fa64e..05e3cccba 100644 --- a/src/templates/layouts/event/index.tsx +++ b/src/templates/layouts/event/index.tsx @@ -75,8 +75,6 @@ export const Event = ({ .filter(Boolean) .join(', ') - const eventCTAText = formatEventCTA(eventCTA) - return (
@@ -230,26 +228,33 @@ export const Event = ({

) : ( <> - {link && eventCTAText && ( - + {link && ( +

+ + {eventCTA && eventCTA != 'more_details' + ? eventCTA.toLowerCase() === 'rsvp' + ? eventCTA.toUpperCase() + : eventCTA.charAt(0).toUpperCase() + eventCTA.slice(1) + : 'More details'} + +

)} {howToSignUp === 'email' && ( <> - {mostRecentDate && eventCTAText && ( - + {mostRecentDate && ( +

+ + {eventCTA && formatEventCTA(eventCTA)} + +

)} )}