Skip to content

Commit

Permalink
QA Fixes: Event Listing Feedback Button, VA Components, I18Next (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttran-Therisa authored Aug 7, 2024
1 parent 0f7e8c8 commit e4e7c22
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 32 deletions.
11 changes: 11 additions & 0 deletions src/assets/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ body {
margin-top: 0;
padding-top: 1.25rem;
}

.feedback-button {
background-color: var(color-primary);
font-size: 1rem;
font-weight: 700;
line-height: 1;
margin-right: 0;
margin-top: 0.3125rem;
height: 44px;
width: 133px;
}
16 changes: 8 additions & 8 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ const Document = () => {
{/* Preconnect to google tag manager domain */}
<link rel="preconnect" href="https://www.googletagmanager.com" />

{/* Add web components */}
<link rel="stylesheet" href={`${ASSETS_URL}web-components.css`} />
<Script
id="web-components"
strategy="afterInteractive"
src={`${ASSETS_URL}web-components.entry.js`}
/>

{/* Preload main fonts */}
<link
rel="preload"
Expand Down Expand Up @@ -75,14 +83,6 @@ const Document = () => {
href="/img/design/icons/favicon.ico"
/>

{/* Add web components */}
<link rel="stylesheet" href={`${ASSETS_URL}web-components.css`} />
<Script
id="web-components"
strategy="afterInteractive"
src={`${ASSETS_URL}web-components.entry.js`}
/>

{/* Add vendor file */}
<Script
id="vendor"
Expand Down
14 changes: 0 additions & 14 deletions src/templates/common/contentFooter/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,4 @@ describe('ContentFooter Component', () => {
'2022-03-28'
)
})

test('renders feedback button correctly', () => {
render(<ContentFooter />)

expect(
screen.getByRole('button', { name: /feedback/i })
).toBeInTheDocument()

fireEvent.click(screen.getByRole('button', { name: /feedback/i }))
expect(
require('@/lib/utils/medallia').getSurveyNumber
).toHaveBeenCalledTimes(1)
expect(require('@/lib/utils/medallia').showForm).toHaveBeenCalledTimes(1)
})
})
12 changes: 4 additions & 8 deletions src/templates/common/contentFooter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useEffect } from 'react'
import { parseDate, getDateParts } from '@/lib/utils/date'
import { MedalliaAssets } from '@/templates/common/medallia'
import { getSurveyNumber, showForm } from '@/lib/utils/medallia'
Expand Down Expand Up @@ -37,11 +37,8 @@ function FeedbackButton() {
return (
<>
<MedalliaAssets />
<button
type="button"
className="feedback-button usa-button"
<va-button
id="mdFormButton"
aria-label="give feedback"
onClick={() => {
const isProduction =
process.env.NEXT_PUBLIC_BUILD_TYPE === BUILD_TYPES.PROD
Expand All @@ -51,9 +48,8 @@ function FeedbackButton() {
)
showForm(surveyNumber)
}}
>
Feedback
</button>
text="Feedback"
></va-button>
</>
)
}
Expand Down
4 changes: 3 additions & 1 deletion src/templates/components/newsStoryTeaser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export const NewsStoryTeaser = ({
<div className="usa-grid usa-grid-full vads-u-margin-bottom--3 medium-screen:vads-u-margin-bottom--4 vads-u-display--flex vads-u-flex-direction--column medium-screen:vads-u-flex-direction--row">
<div className="usa-width-two-thirds">
<TitleTag className="vads-u-font-size--md medium-screen:vads-u-font-size--lg medium-screen:vads-u-margin-bottom--0p5">
<a href={link}>{title}</a>
<va-link href={link} text={title}>
{title}
</va-link>
</TitleTag>
<p className="vads-u-margin-y--0">
{truncateWordsOrChar(introText, 60, true)}
Expand Down
4 changes: 3 additions & 1 deletion src/templates/components/pressReleaseTeaser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export function PressReleaseTeaser({
<>
<section className="vads-u-margin-bottom--4">
<TitleTag className="vads-u-margin-bottom--1p5 vads-u-font-size--md medium-screen:vads-u-font-size--lg">
<a href={link}>{title}</a>
<va-link href={link} text={title}>
{title}
</va-link>
</TitleTag>
<strong>{formatDate(lastUpdated)}</strong>
<p className="vads-u-margin-top--0">
Expand Down

0 comments on commit e4e7c22

Please sign in to comment.