-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sc-2474-guardian-directory-search
- Loading branch information
Showing
19 changed files
with
322 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,11 @@ describe('Feedback Card component', () => { | |
render(<FeedbackCard />) | ||
|
||
expect( | ||
screen.getByRole('heading', { level: 2, name: 'Got feedback?' }) | ||
screen.getByRole('heading', { level: 3, name: 'Got Feedback?' }) | ||
).toBeInTheDocument() | ||
expect( | ||
screen.getByRole('link', { name: '[email protected]' }) | ||
).toBeInTheDocument() | ||
expect( | ||
screen.getByRole('link', { name: 'Send us feedback' }) | ||
).toBeInTheDocument() | ||
}) | ||
|
||
describe('trackEvent functions called', () => { | ||
|
@@ -48,18 +45,6 @@ describe('Feedback Card component', () => { | |
render(<FeedbackCard />) | ||
}) | ||
|
||
it("calls trackEvent when clicking 'Send us feedback' link", () => { | ||
const link = screen.getByRole('link', { name: 'Send us feedback' }) | ||
|
||
fireEvent.click(link) | ||
|
||
expect(mockTrackEvents).toHaveBeenCalledTimes(1) | ||
expect(mockTrackEvents).toHaveBeenCalledWith( | ||
'Feedback', | ||
'Send us feedback' | ||
) | ||
}) | ||
|
||
it("calls trackEvent when clicking '[email protected]' link", () => { | ||
const link = screen.getByRole('link', { name: '[email protected]' }) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import React from 'react' | ||
|
||
import styles from './FeedbackCard.module.scss' | ||
|
||
import { useAnalytics } from 'stores/analyticsContext' | ||
|
||
const FEEDBACK_EMAIL = '[email protected]' | ||
|
@@ -11,28 +9,19 @@ const FeedbackCard = () => { | |
const { trackEvent } = useAnalytics() | ||
|
||
return ( | ||
<div className={styles.FeedbackCard}> | ||
<h2>Got feedback?</h2> | ||
<div> | ||
<h3>Got Feedback?</h3> | ||
<p> | ||
We’d love to hear it! Contact us at{' '} | ||
<a | ||
href={`mailto:${FEEDBACK_EMAIL}?subject=${FEEDBACK_SUBJECT}`} | ||
target="_blank" | ||
rel="noreferrer noopener" | ||
className="usa-link" | ||
onClick={() => trackEvent('Feedback', FEEDBACK_EMAIL)}> | ||
{FEEDBACK_EMAIL} | ||
</a>{' '} | ||
to send us your thoughts or schedule an interview. | ||
</p> | ||
<a | ||
href={`mailto:${FEEDBACK_EMAIL}?subject=${FEEDBACK_SUBJECT}`} | ||
target="_blank" | ||
rel="noreferrer noopener" | ||
className="usa-button" | ||
onClick={() => trackEvent('Feedback', 'Send us feedback')}> | ||
Send us feedback | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.