Skip to content

Commit

Permalink
Merge branch 'main' into VACMS-20163-news-release-contact-number
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseek authored Mar 4, 2025
2 parents e16ef69 + ae9413a commit dd61b73
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Description
What does this PR address?

## Generated description
(Select this text, hit the Copilot button, and select "Generate".)

## Ticket
Relates to #[TICKET_NUMBER](https://github.com/department-of-veterans-affairs/va.gov-cms/issues/TICKET_NUMBER). (or closes?)

Expand Down
30 changes: 30 additions & 0 deletions src/templates/layouts/event/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,34 @@ describe('<Event /> Component', () => {
render(<Event {...data} />)
expect(screen.getByText('3307 10th Avenue Southeast')).toBeInTheDocument()
})

describe('va-links in paragraph tags', () => {
it('always wraps outreach link in paragraph tag', () => {
render(<Event {...data} />)
const outreachLink = document.querySelector(
'va-link[href="/outreach-and-events/events/"]'
)
expect(outreachLink).not.toBeNull()
expect(outreachLink?.parentElement?.tagName.toLowerCase()).toBe('p')
})

it('wraps administration link in paragraph tag when present', () => {
render(
<Event
{...data}
administration={{
id: 1,
name: 'Test Administration',
}}
listing="/test-listing"
listingOffice="Test Office"
/>
)
const seeMoreLink = document.querySelector(
'va-link[id="see-more-events"]'
)
expect(seeMoreLink).not.toBeNull()
expect(seeMoreLink?.parentElement?.tagName.toLowerCase()).toBe('p')
})
})
})
30 changes: 16 additions & 14 deletions src/templates/layouts/event/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,21 +332,23 @@ export const Event = ({
{administration?.id != 7 &&
listingOffice != 'Outreach and events' &&
administration?.name && (
<va-link
class="vads-u-display--block vads-u-margin-top--2"
href={listing}
onClick={() =>
recordEvent({ event: 'nav-secondary-button-click' })
}
id="see-more-events"
text={`Browse the ${administration.name} events calendar`}
></va-link>
<p>
<va-link
href={listing}
onClick={() =>
recordEvent({ event: 'nav-secondary-button-click' })
}
id="see-more-events"
text={`Browse the ${administration.name} events calendar`}
></va-link>
</p>
)}
<va-link
class="vads-u-padding-bottom--3 vads-u-margin-top--2 vads-u-display--block"
href="/outreach-and-events/events/"
text="Browse the VA outreach events calendar"
></va-link>
<p>
<va-link
href="/outreach-and-events/events/"
text="Browse the VA outreach events calendar"
></va-link>
</p>
<ContentFooter lastUpdated={lastUpdated} />
</div>
</div>
Expand Down

0 comments on commit dd61b73

Please sign in to comment.