-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DBEX] add mental health intro & events content
- Loading branch information
1 parent
1fe81d3
commit 2bd5e99
Showing
11 changed files
with
366 additions
and
23 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
21 changes: 19 additions & 2 deletions
21
src/applications/disability-benefits/all-claims/content/mentalHealthSupport.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 |
---|---|---|
@@ -1,4 +1,21 @@ | ||
// TODO: additional content will be added in ticket #97079 | ||
import React from 'react'; | ||
import { mentalHealthSupportResources } from './form0781'; | ||
|
||
/* ---------- content ----------*/ | ||
export const mentalHealthSupportPageTitle = 'Mental health support'; | ||
|
||
export const mentalHealthSupportDescription = () => { | ||
return ( | ||
<> | ||
<p> | ||
On the next screen, we’ll ask you about your mental health conditions. | ||
<br /> | ||
<br /> | ||
First, we want you to know that you can get support for your mental | ||
health any time, day or night. | ||
</p> | ||
<h4>Resources that may be helpful</h4> | ||
<br /> | ||
{mentalHealthSupportResources} | ||
</> | ||
); | ||
}; |
5 changes: 2 additions & 3 deletions
5
src/applications/disability-benefits/all-claims/content/traumaticEventTypes.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
42 changes: 40 additions & 2 deletions
42
src/applications/disability-benefits/all-claims/content/traumaticEventsIntro.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 |
---|---|---|
@@ -1,4 +1,42 @@ | ||
// TODO: additional content will be added in ticket #97079 | ||
import React from 'react'; | ||
|
||
/* ---------- content ----------*/ | ||
export const eventsPageTitle = 'Traumatic events'; | ||
|
||
export const eventsIntroDescription = () => { | ||
return ( | ||
<> | ||
<p> | ||
We want to know about any traumatic events during your military service. | ||
<br /> | ||
<br /> | ||
Any information you provide will help us understand your situation and | ||
identify evidence to support your claim. All the questions are optional. | ||
You can provide only details that you’re comfortable sharing. | ||
</p> | ||
<h4>Information we’ll ask you for</h4> | ||
<p> | ||
We’ll ask you for this information: | ||
<ul> | ||
<li> | ||
Whether your event was related to combat, personal interactions, | ||
military sexual trauma (MST), something else, or any combination of | ||
these | ||
</li> | ||
<li> | ||
A brief description, location, and approximate time frame of your | ||
event | ||
</li> | ||
<li> | ||
Details about any official reports that were filed, if applicable | ||
</li> | ||
</ul> | ||
</p> | ||
<h4>You can take a break at any time</h4> | ||
<p> | ||
We understand that some of the questions may be difficult to answer. You | ||
can take a break at any time and come back to continue your application | ||
later. We’ll save the information you’ve entered so far. | ||
</p> | ||
</> | ||
); | ||
}; |
12 changes: 7 additions & 5 deletions
12
src/applications/disability-benefits/all-claims/pages/form0781/mentalHealthSupport.js
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
26 changes: 20 additions & 6 deletions
26
src/applications/disability-benefits/all-claims/pages/form0781/traumaticEventsIntro.js
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,13 +1,27 @@ | ||
// TODO: this is a placeholder; structure will be added in ticket #97079 | ||
import { eventsPageTitle } from '../../content/traumaticEventsIntro'; | ||
|
||
import { formTitle } from '../../utils'; | ||
import { | ||
eventsPageTitle, | ||
eventsIntroDescription, | ||
} from '../../content/traumaticEventsIntro'; | ||
import { | ||
titleWithTag, | ||
form0781HeadingTag, | ||
mentalHealthSupportAlert, | ||
} from '../../content/form0781'; | ||
|
||
export const uiSchema = { | ||
'ui:title': formTitle(eventsPageTitle), | ||
'ui:title': titleWithTag(eventsPageTitle, form0781HeadingTag), | ||
'ui:description': eventsIntroDescription, | ||
'view:mentalHealthSupportAlert': { | ||
'ui:description': mentalHealthSupportAlert, | ||
}, | ||
}; | ||
|
||
export const schema = { | ||
type: 'object', | ||
properties: {}, | ||
properties: { | ||
'view:mentalHealthSupportAlert': { | ||
type: 'object', | ||
properties: {}, | ||
}, | ||
}, | ||
}; |
45 changes: 44 additions & 1 deletion
45
...ions/disability-benefits/all-claims/tests/pages/form0781/mentalHealthSupport.unit.spec.js
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,12 +1,55 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { expect } from 'chai'; | ||
import * as mentalHealthSupport from '../../../pages/form0781/mentalHealthSupport'; | ||
import { | ||
mentalHealthSupportPageTitle, | ||
mentalHealthSupportDescription, | ||
} from '../../../content/mentalHealthSupport'; | ||
import { titleWithTag, form0781HeadingTag } from '../../../content/form0781'; | ||
|
||
describe('Mental health support', () => { | ||
describe('Mental health support page', () => { | ||
it('should define a uiSchema object', () => { | ||
expect(mentalHealthSupport.uiSchema).to.be.an('object'); | ||
}); | ||
|
||
it('should define a schema object', () => { | ||
expect(mentalHealthSupport.schema).to.be.an('object'); | ||
}); | ||
|
||
it('should have the correct title in uiSchema', () => { | ||
const { container: uiTitleContainer } = render( | ||
<div>{mentalHealthSupport.uiSchema['ui:title']}</div>, | ||
); | ||
const renderedUITitleText = uiTitleContainer.textContent.trim(); | ||
|
||
const { container: titleWithTagContainer } = render( | ||
<div> | ||
{titleWithTag(mentalHealthSupportPageTitle, form0781HeadingTag)} | ||
</div>, | ||
); | ||
const expectedTitleText = titleWithTagContainer.textContent.trim(); | ||
|
||
expect(renderedUITitleText).to.equal(expectedTitleText); | ||
}); | ||
|
||
it('should have the correct description in uiSchema', () => { | ||
expect(mentalHealthSupport.uiSchema['ui:description']).to.equal( | ||
mentalHealthSupportDescription, | ||
); | ||
}); | ||
|
||
it('should have correct schema structure', () => { | ||
expect(mentalHealthSupport.schema) | ||
.to.have.property('type') | ||
.that.equals('object'); | ||
expect(mentalHealthSupport.schema) | ||
.to.have.property('properties') | ||
.that.is.an('object'); | ||
}); | ||
|
||
it('should not have additional properties in schema', () => { | ||
const properties = Object.keys(mentalHealthSupport.schema.properties); | ||
expect(properties).to.have.lengthOf(0); | ||
}); | ||
}); |
Oops, something went wrong.