-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Travel Pay OMB information (#33514)
* Add Travel Pay OMB information * Update tests * Update comment * Add translations * Extract email from translation text
- Loading branch information
1 parent
1dcd416
commit 186c85e
Showing
7 changed files
with
114 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from 'react'; | ||
import { Trans } from 'react-i18next'; | ||
|
||
// OMB Details | ||
const EXP_DATE = '11/30/2027'; | ||
const OMB_NUMBER = '2900-0798'; | ||
const RES_BURDEN_MIN = '10'; | ||
const VACO_PRA_EMAIL = '[email protected]'; | ||
|
||
const TravelPayOMB = () => { | ||
return ( | ||
<va-omb-info | ||
exp-date={EXP_DATE} | ||
omb-number={OMB_NUMBER} | ||
res-burden={RES_BURDEN_MIN} | ||
data-testid="travel-pay-omb" | ||
class="vads-u-margin-y--4" | ||
> | ||
<p data-testid="travel-pay-omb-burdern-statement"> | ||
<Trans | ||
i18nKey="travel-pay-omb-burdern-statement" | ||
components={[ | ||
<strong key="bold" />, | ||
<a | ||
key="link" | ||
href={`mailto:${VACO_PRA_EMAIL}`} | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
{VACO_PRA_EMAIL} | ||
</a>, | ||
]} | ||
values={{ | ||
ombNumber: OMB_NUMBER, | ||
expDate: EXP_DATE, | ||
resBurden: RES_BURDEN_MIN, | ||
vaEmail: VACO_PRA_EMAIL, | ||
}} | ||
/> | ||
</p> | ||
|
||
<p data-testid="travel-pay-omb-privacy-act-info"> | ||
<Trans | ||
i18nKey="travel-pay-omb-privacy-act" | ||
components={[<strong key="bold" />]} | ||
/> | ||
</p> | ||
</va-omb-info> | ||
); | ||
}; | ||
|
||
export default TravelPayOMB; |
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
39 changes: 39 additions & 0 deletions
39
src/applications/check-in/components/tests/TravelPayOMB.unit.spec.jsx
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import { render } from '@testing-library/react'; | ||
|
||
import TravelPayOMB from '../TravelPayOMB'; | ||
|
||
describe('check-in', () => { | ||
describe('TravelPayOMB', () => { | ||
it('renders the OMB information correctly', () => { | ||
const { getByTestId } = render(<TravelPayOMB />); | ||
|
||
// Verify the `va-omb-info` element exists with the correct data-testid | ||
const ombInfo = getByTestId('travel-pay-omb'); | ||
expect(ombInfo).to.exist; | ||
|
||
// Verify the `exp-date` prop | ||
expect(ombInfo.getAttribute('exp-date')).to.equal('11/30/2027'); | ||
|
||
// Verify the `omb-number` prop | ||
expect(ombInfo.getAttribute('omb-number')).to.equal('2900-0798'); | ||
|
||
// Verify the `res-burden` prop | ||
expect(ombInfo.getAttribute('res-burden')).to.equal('10'); | ||
|
||
// Verify text content within the component | ||
// Verify the Burder Statement Act section | ||
const burderStatement = getByTestId('travel-pay-omb-burdern-statement'); | ||
expect(burderStatement).to.exist; | ||
// Verify the statement includes the OMB information | ||
expect(burderStatement.textContent).to.include('2900-0798'); | ||
expect(burderStatement.textContent).to.include('11/30/2027'); | ||
expect(burderStatement.textContent).to.include('10 minutes'); | ||
|
||
// Verify the Privacy Act section | ||
const privayActInfo = getByTestId('travel-pay-omb-privacy-act-info'); | ||
expect(privayActInfo).to.exist; | ||
}); | ||
}); | ||
}); |
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
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