Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

17338 test improvements #465

Merged
merged 5 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/data/queries/alertNonReusable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Define the query params for fetching block--alert.
import { BlockAlert } from '@/types/drupal/block'
import { QueryFormatter } from 'next-drupal-query'
import { AlertType, AlertNonReusable } from '@/types/formatted/alert'
import { ParagraphNonReusableAlert } from '@/types/drupal/paragraph'
Expand Down
19 changes: 19 additions & 0 deletions src/data/queries/tests/__snapshots__/alert.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`alert formatData outputs formatted data 1`] = `
{
"alertType": "information",
"blockReference": null,
"entityId": 6003,
"heading": "Blue Water Navy Veterans and Agent Orange",
"id": "019070f3-9e3e-4c69-83e4-c7eace8c414f",
"paragraphs": [
{
"html": "<p>Blue Water Navy Veterans are now entitled to a presumption of service connection for illnesses related to Agent Orange exposure. This is a result of <a href="https://www.congress.gov/bill/116th-congress/house-bill/299/text" target="_blank">Public Law 116-23</a>, the Blue Water Navy Vietnam Veterans Act of 2019. The law was signed on June 25, 2019, and takes effect on January 1, 2020.</p><p>Read below to learn more about eligibility requirements and how to file a claim. If we denied your claim in the past, you can file a new claim based on this change in law.</p>",
"id": "abb45dcb-b33f-4080-b20f-2f89d4281806",
"type": "paragraph--wysiwyg",
},
],
"type": "paragraph--alert",
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`alert non reusable formatData outputs formatted data 1`] = `
{
"alertType": "info",
"entityId": 13072,
"heading": "Sample non-reusable alert",
"id": "4eff76c1-5e3e-410b-a56a-64b572f98756",
"paragraphs": [
{
"html": "<p>This is where the text goes for the alert</p>",
"id": "2fc092f1-969a-4136-9039-4fc50a9f93c4",
"type": "paragraph--wysiwyg",
},
],
"type": "paragraph--non_reusable_alert",
}
`;
23 changes: 23 additions & 0 deletions src/data/queries/tests/__snapshots__/alertSingle.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`alert single formatData outputs formatted data 1`] = `
{
"alertSelection": "R",
"blockReference": {
"alertType": "info",
"content": {
"html": "<p>Get the latest information about in-person services, claim exams, extensions, paperwork, decision reviews and appeals, and how best to contact us during this time.</p>

<p><a href="/coronavirus-veteran-frequently-asked-questions/#claims-and-applications">Go to our coronavirus FAQs</a></p>",
"id": "65fda9e9-1bbb-45f2-bc39-d3c659ba30d1",
"type": "paragraph--wysiwyg",
},
"id": "ba9dd3f4-4260-4e21-bbf9-a5cf0db49fc1",
"title": "You can still file a claim and apply for benefits during the coronavirus pandemic",
},
"entityId": 13070,
"id": "0e71c5cd-a4e2-4dec-9b1e-0ef1c5666f65",
"nonReusableRef": null,
"type": "paragraph--alert_single",
}
`;
9 changes: 9 additions & 0 deletions src/data/queries/tests/__snapshots__/banners.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ exports[`Banners return formatted data outputs formatted data 1`] = `
},
{
"alertType": "warning",
"bannerAlertVamcs": [
{
"id": 2363,
"office": {
"path": null,
},
"path": "/butler-health-care/operating-status",
},
],
"body": "<p>this is a full width banner alert</p>",
"dismiss": true,
"emailUpdatesButton": true,
Expand Down
127 changes: 127 additions & 0 deletions src/data/queries/tests/__snapshots__/collapsiblePanel.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Collapsible Panel formatData outputs formatted data 1`] = `
{
"bordered": false,
"entityId": 2862,
"id": "cc597ad6-123b-49b4-bf90-2edae8b355bc",
"multiSelect": false,
"paragraphs": [
{
"entityId": 2861,
"id": "768a4d33-0552-49d8-a9e1-c66d5ae689f5",
"paragraphs": [],
"title": "Homeless services",
"type": "paragraph--collapsible_panel_item",
"wysiwyg": "<h2>24/7 VA helpline for homeless or at-risk Veterans: 877-4AID-VET (877-424-3838)</h2>

<p><strong>@Shelley's team&nbsp;</strong>If functionality is available, this could be an alert box or similar component</p>

<p>If you are a Veteran who is homeless or at risk of becoming homeless due to financial hardship, unemployment, addiction, depression, or transition from jail, VA Pittsburgh can help you with:</p>

<ul>
<li>Immediate food and shelter needs</li>
<li>Transitional and permanent housing</li>
<li>Job training and life skills development</li>
<li>Educational opportunities</li>
<li>Support with justice system navigation</li>
<li>Re-entry from jail into the community</li>
<li>Financial support to prevent homelessness</li>
<li>Treatment for addiction and depression</li>
<li>Health and dental care</li>
<li>Case management</li>
</ul>

<p><strong>@Shelley's team</strong> may want to consider whether different care coordinators should be listed on different accordions. For example, should Mary Frances be listed here because she handles all general incoming requests for homeless services, while Linda should be listed on the "permanent housing" accordion because she handles HUD-VASH cases?</p>

<p>For local help getting started with any of these services, contact a VA Pittsburgh homeless services care coordinator. We can help determine what programs are right for you.</p>

<h3>Homeless services care coordinators</h3>

<p>Mary Frances Pilarski<br>
Coordinator for homeless Veterans health care<br>
412-822-1272 (direct)<br>
866-482-7488, ext. 221272 (outside the Pittsburgh area)<br>
<a href="mailto:[email protected]">[email protected]</a></p>

<p>Keather Likins<br>
Outreach social worker<br>
412-822-1409<br>
<a href="mailto:[email protected]">[email protected]</a></p>

<p>Linda Crawford<br>
HUD-VASH social worker<br>
412-822-1271<br>
<a href="mailto:[email protected]">[email protected]</a></p>

<p>Joseph Savino<br>
Transitional housing liaison<br>
412-822-1295<br>
<a href="mailto:[email protected]">[email protected]</a></p>

<p>Mary Henderson<br>
Veterans benefits counselor<br>
412-822-1275<br>
&lt;insert email&gt;</p>

<p>You can also come in person to this office at this location to talk to someone about which homeless services are right for you.</p>

<h3>For Veterans struggling with addiction or substance abuse</h3>

<p>You can enroll in our intensive 14 or 21-day behavioral health program to start your recovery from alcohol or drug addiction. Call us at 412-360-6110 or 412-360-6092</p>

<h3>Center for Treatment of Addictive Disorders</h3>

<p>University Drive campus [Link to: University Drive campus page, API]<br>
First floor, check-in area 3</p>

<h3>For help with finding and keeping a job</h3>

<p>We can help you develop the skills to find and keep a job. We can also connect you with VA programs that allow you to earn a competitive wage (such as the state minimum wage).</p>

<h4>Contact</h4>

<hr>
<p><strong>@Shelley team:&nbsp;</strong>For contacts like this, we need to answer these questions: Does Joseph only handle transitional housing cases? (If so, only list him with the transitional housing info.) Does John act as a care coordinator for ALL homeless services? (If so, consider listing him here but leaving off the title "Transitional housing liaison", which is distracting to the user and makes them wonder if he's the right person to be contacting.)</p>

<p><strong>@Shelley team:</strong> This name and number is on a PDF brochure for Pittsburgh VA homeless services, but not on the web page. Not sure whether to include.</p>

<p><strong>@Shelley team:</strong> to fill in, if this is a viable way to get help with homeless services</p>

<p><strong>@Shelley team:&nbsp;</strong>Both these numbers are listed in the directory. Only the first is listed on the website page. Which is better? Why?</p>

<p><strong>@Shelley team:&nbsp;</strong>Giving the name and location of this program here might be distracting, as the CTA is really just to call the number.</p>

<p>John Erskine<br>
412-822-1285<br>
<a href="mailto:[email protected]">[email protected]</a></p>

<h3>For Veterans with justice involvement or transitioning out of prison</h3>

<p>We connect Veterans in local courts and jails with services to help them reintegrate back into their communities as smoothly as possible. We can provide housing and employment opportunities, health care, and access to VA benefits. Call us at 412-822-1275.</p>

<h3>For Veterans with psychiatric disorders</h3>

<p>We provide residential programs for Veterans struggling with psychiatric disorders and help them transition back into their communities. Contact:</p>

<p>Bridget Wright<br>
412-822-1403<br>
&lt;email&gt;</p>

<p><a>Tim Morrison<br>
412-822-1399</a><br>
<a href="mailto:[email protected]">[email protected]</a></p>

<p><strong>@Shelley: </strong>Is this a common term? If I were a user I don’t know that I’d understand it.</p>

<p>Listed as contact on a resources page for homeless Veterans</p>

<p>Listed on brochure for the Recovery Center for Veterans under the header for Residential Treatment for Psychiatric Disorders</p>

<p><strong>@Shelley: </strong>Can we specify what they do/what their titles are?</p>",
},
],
"startExpanded": false,
"type": "paragraph--collapsible_panel",
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Collapsible Panel Item formatData outputs formatted data 1`] = `
{
"entityId": 17,
"id": "c6436d3e-9c0f-4ead-a930-a20bc53dae12",
"paragraphs": [],
"title": "I have a service-connected dental disability or condition for which I receive compensation (monthly payments).",
"type": "paragraph--collapsible_panel_item",
"wysiwyg": "<p><strong>You’re in:</strong> Class I</p> <p><strong>You may qualify for:</strong> Any needed dental care</p>",
}
`;
85 changes: 85 additions & 0 deletions src/data/queries/tests/__snapshots__/eventTeaser.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`event teaser formatData outputs formatted data 1`] = `
{
"changed": "2023-08-16T15:20:30+00:00",
"entityBundle": "node--event",
"entityId": "16349f16-be65-46e3-9660-1d3d598a4a0b",
"entityPublished": true,
"entityUrl": {
"path": "/central-iowa-health-care/events/52265",
},
"fieldAdditionalInformationAbo": null,
"fieldAdditionalListings": null,
"fieldAddress": {
"addressLine1": "9000 Douglas Ave",
"addressLine2": null,
"administrativeArea": "IA",
"countryCode": "US",
"locality": "Urbandale",
"postalCode": null,
},
"fieldAdministration": {
"entity": {
"entityId": "3a530a55-e922-48de-b18c-9c9f92a9ae98",
},
},
"fieldBody": {
"format": "rich_text",
"processed": "<p>Pickleball Club</p>

<p>Meets Thursdays from 9 to 11 a.m. </p>

<p>Contact Kay Queck (515) 214-4578</p>",
"value": "<p>Pickleball Club</p>

<p>Meets Thursdays from 9 to 11 a.m.&nbsp;</p>

<p>Contact Kay Queck (515) 214-4578</p>
",
},
"fieldCtaEmail": "[email protected]",
"fieldDatetimeRangeTimezone": [
{
"duration": 120,
"endTime": "2023-09-07T16:00:00+00:00",
"endValue": 1694102400,
"end_value": "2023-09-07T16:00:00+00:00",
"rrule": 180,
"rrule_index": 1,
"startTime": "2023-09-07T14:00:00+00:00",
"timezone": "America/Chicago",
"value": 1694095200,
},
{
"duration": 120,
"endTime": "2023-09-14T16:00:00+00:00",
"endValue": 1694707200,
"end_value": "2023-09-14T16:00:00+00:00",
"rrule": 180,
"rrule_index": 2,
"startTime": "2023-09-14T14:00:00+00:00",
"timezone": "America/Chicago",
"value": 1694700000,
},
],
"fieldDescription": "Pickleball ",
"fieldEventCost": "Free",
"fieldEventCta": null,
"fieldEventRegistrationrequired": false,
"fieldFacilityLocation": null,
"fieldFeatured": false,
"fieldHowToSignUp": "email",
"fieldLink": null,
"fieldListing": {
"entity": {
"entityId": "55cb823c-df6d-4f77-814d-6024e08cd4f6",
},
},
"fieldLocationHumanreadable": "Walker Johnston Park",
"fieldLocationType": "non_facility",
"fieldOrder": null,
"fieldUrlOfAnOnlineEvent": null,
"title": "Pickleball Club",
}
`;
18 changes: 18 additions & 0 deletions src/data/queries/tests/__snapshots__/healthServices.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`healthServices formatData outputs formatted data 1`] = `
[
{
"alsoKnownAs": null,
"body": "<p>Military sexual trauma can happen to both men and women. If you experienced sexual assault or harassment during military service - no matter when you served – we provide counseling and treatment.</p>
",
"commonlyTreatedCondition": null,
"description": "Military sexual trauma can happen to both genders. If you experienced sexual assault or harassment during military service—no matter when you served—we provide counseling and treatment.",
"name": "Military sexual trauma care",
"vetCenterComConditions": null,
"vetCenterFriendlyName": null,
"vetCenterServiceDescription": "If you experienced sexual assault or harassment during military service, we can help you get the counseling you need. Any Veteran or service member, including members of the National Guard and Reserve forces, who experienced military sexual trauma is eligible to receive counseling. This applies to people of all genders from any service era.",
"vetCenterTypeOfCare": "counseling",
},
]
`;
16 changes: 16 additions & 0 deletions src/data/queries/tests/__snapshots__/promoBlock.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`promoBlock formatData outputs formatted data 1`] = `
{
"description": "Download letters like your eligibility or award letter for certain benefits.",
"id": 14,
"img": {
"alt": null,
"src": "https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov/sites/default/files/styles/7_2_medium_thumbnail/public/2020-04/040120_FEATURE_MarchFCVet20.png",
},
"link": {
"href": "internal:/records/download-va-letters/",
"text": "Confirm your VA benefit status",
},
}
`;
19 changes: 19 additions & 0 deletions src/data/queries/tests/__snapshots__/reactWidget.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`React widget formatData outputs formatted data 1`] = `
{
"buttonFormat": true,
"ctaWidget": false,
"defaultLink": {
"title": "Apply for Veterans Pension Benefits",
"url": "/pension/application/527EZ",
},
"entityId": 4102,
"errorMessage": "<strong>We’re sorry. Something went wrong when we tried to load your saved application.</strong><br>Please try refreshing your browser in a few minutes.",
"id": "5663a0dd-a69c-40b7-b50b-526646e32204",
"loadingMessage": "Checking your application status.",
"timeout": 20,
"type": "paragraph--react_widget",
"widgetType": "health-care-app-status",
}
`;
Loading
Loading