diff --git a/src/applications/facility-locator/components/search-results-items/CCProviderResult.jsx b/src/applications/facility-locator/components/search-results-items/CCProviderResult.jsx index 040e18d5ef46..533f82e214cd 100644 --- a/src/applications/facility-locator/components/search-results-items/CCProviderResult.jsx +++ b/src/applications/facility-locator/components/search-results-items/CCProviderResult.jsx @@ -5,6 +5,7 @@ import LocationDirectionsLink from './common/LocationDirectionsLink'; import LocationPhoneLink from './common/LocationPhoneLink'; import ProviderServiceDescription from '../ProviderServiceDescription'; import LocationDistance from './common/LocationDistance'; +import ProviderTraining from './common/ProviderTraining'; const CCProviderResult = ({ provider, query }) => { const { name } = provider.attributes; @@ -23,11 +24,12 @@ const CCProviderResult = ({ provider, query }) => {
{provider.attributes.orgName}
)} + - + diff --git a/src/applications/facility-locator/components/search-results-items/EmergencyCareResult.jsx b/src/applications/facility-locator/components/search-results-items/EmergencyCareResult.jsx index 0142722203ee..e1b0895b235e 100644 --- a/src/applications/facility-locator/components/search-results-items/EmergencyCareResult.jsx +++ b/src/applications/facility-locator/components/search-results-items/EmergencyCareResult.jsx @@ -7,6 +7,7 @@ import LocationDirectionsLink from './common/LocationDirectionsLink'; import LocationPhoneLink from './common/LocationPhoneLink'; import LocationDistance from './common/LocationDistance'; +import ProviderTraining from './common/ProviderTraining'; const EmergencyCareResult = ({ provider, query }) => { const { name } = provider.attributes; @@ -24,6 +25,7 @@ const EmergencyCareResult = ({ provider, query }) => {
{provider.attributes.orgName}
)} + { const { name } = provider.attributes; @@ -24,6 +25,7 @@ const UrgentCareResult = ({ provider, query }) => {
{provider.attributes.orgName}
)} + + + Provider core training +

+ ); +} + +ProviderTraining.propTypes = { + provider: PropTypes.shape({ + id: PropTypes.string, + attributes: PropTypes.shape({ + trainings: PropTypes.arrayOf(PropTypes.shape({})), + }), + }), +}; + +export default ProviderTraining; diff --git a/src/applications/facility-locator/constants/mock-facility-data-v2.json b/src/applications/facility-locator/constants/mock-facility-data-v2.json new file mode 100644 index 000000000000..9c947e5b6763 --- /dev/null +++ b/src/applications/facility-locator/constants/mock-facility-data-v2.json @@ -0,0 +1,125 @@ +{ + "data": [ + { + "id": "a", + "type": "provider", + "attributes": { + "accNewPatients": "true", + "address": { + "street": "401 N 17TH ST STE 311", + "city": "ALLENTOWN", + "state": "PA", + "zip": "18104-5051" + }, + "caresitePhone": "610-969-4470", + "email": null, + "fax": null, + "gender": "Male", + "lat": 40.60274, + "long": -75.494775, + "name": "BRIGIDO, STEPHEN", + "phone": null, + "posCodes": null, + "prefContact": null, + "trainings": [], + "uniqueId": "1407853336" + } + }, + { + "id": "b", + "type": "provider", + "attributes": { + "accNewPatients": "true", + "address": { + "street": "401 N 17TH ST STE 105", + "city": "ALLENTOWN", + "state": "PA", + "zip": "18104-5049" + }, + "caresitePhone": "610-969-4470", + "email": null, + "fax": null, + "gender": "Male", + "lat": 40.60274, + "long": -75.494775, + "name": "OFRICHTER, WILLIAM", + "phone": null, + "posCodes": null, + "prefContact": null, + "trainings": [ + { + "courseName": "Opioid Safety Initiative (OSI)", + "courseCode": "1086479", + "courseCompletionDate": "2/11/2020 12:00:00 AM", + "courseExpirationDate": null, + "courseStatus": "Active" + } + ], + "uniqueId": "1689649824" + } + }, + { + "id": "c", + "type": "provider", + "attributes": { + "accNewPatients": "true", + "address": { + "street": "401 N 17TH ST STE 311", + "city": "ALLENTOWN", + "state": "PA", + "zip": "18104-5051" + }, + "caresitePhone": "610-969-4470", + "email": null, + "fax": null, + "gender": "Female", + "lat": 40.60274, + "long": -75.494775, + "name": "BAKER, LORA", + "phone": null, + "posCodes": null, + "prefContact": null, + "trainings": [ + { + "courseName": "A Perspective for Veteran Care", + "courseCode": "1085488", + "courseCompletionDate": "2/5/2020 12:00:00 AM", + "courseExpirationDate": null, + "courseStatus": "Active" + }, + { + "courseName": "Opioid Safety Initiative (OSI)", + "courseCode": "1073710", + "courseCompletionDate": "2/4/2020 12:00:00 AM", + "courseExpirationDate": null, + "courseStatus": "Active" + }, + { + "courseName": "Opioid Safety Initiative (OSI)", + "courseCode": "1086479", + "courseCompletionDate": "2/4/2020 12:00:00 AM", + "courseExpirationDate": null, + "courseStatus": "Active" + } + ], + "uniqueId": "1235114331" + } + } + ], + "meta": { + "pagination": { + "currentPage": 1, + "prevPage": null, + "nextPage": null, + "totalPages": 1, + "totalEntries": 10 + } + }, + "links": { + "self": "https://dev-api.va.gov/facilities_api/v2/ccp?lat=40.599919&long=-75.497373&page=1&per_page=10&radius=10&specialties%5B%5D=213E00000X", + "first": "https://dev-api.va.gov/facilities_api/v2/ccp?lat=40.599919&long=-75.497373&page=1&per_page=10&radius=10&specialties%5B%5D=213E00000X", + "prev": null, + "next": null, + "last": "https://dev-api.va.gov/facilities_api/v2/ccp?lat=40.599919&long=-75.497373&page=1&per_page=10&radius=10&specialties%5B%5D=213E00000X" + } +} \ No newline at end of file diff --git a/src/applications/facility-locator/sass/facility-locator.scss b/src/applications/facility-locator/sass/facility-locator.scss index c956288fd357..4b56d06ef7c4 100644 --- a/src/applications/facility-locator/sass/facility-locator.scss +++ b/src/applications/facility-locator/sass/facility-locator.scss @@ -608,4 +608,8 @@ canvas.mapboxgl-canvas:focus { outline: 2px solid rgb(249, 198, 66) !important; outline-offset: 2px !important; transition: none !important; +} + +.success-icon { + color: var(--vads-color-success) !important; } \ No newline at end of file diff --git a/src/applications/facility-locator/tests/components/ProviderTraining.unit.spec.jsx b/src/applications/facility-locator/tests/components/ProviderTraining.unit.spec.jsx new file mode 100644 index 000000000000..e664d2523b68 --- /dev/null +++ b/src/applications/facility-locator/tests/components/ProviderTraining.unit.spec.jsx @@ -0,0 +1,45 @@ +import React from 'react'; +import { expect } from 'chai'; +import { render } from '@testing-library/react'; +import CCProviderResult from '../../components/search-results-items/CCProviderResult'; +import testData from '../../constants/mock-facility-data-v2.json'; + +describe('CCProviderResult With Training', () => { + it('Should render CCProviderResult, serviceType Podiatrist without training', async () => { + const query = { + facilityType: 'provider', + serviceType: '213E00000X', // Podiatrist + }; + const wrapper = render( + , + ); + // should not exist because no trainings + expect(wrapper.queryAllByTestId('training-a')).to.have.length(0); + wrapper.unmount(); + }); + + it('Should render CCProviderResult, serviceType Podiatrist with 1 training', async () => { + const query = { + facilityType: 'provider', + serviceType: '213E00000X', // Podiatrist + }; + const wrapper = render( + , + ); + expect(wrapper.queryAllByTestId('training-b')).to.have.length(1); + wrapper.unmount(); + }); + + it('Should render CCProviderResult, serviceType Podiatrist with 3 training', async () => { + const query = { + facilityType: 'provider', + serviceType: '213E00000X', // Podiatrist + }; + const wrapper = render( + , + ); + // stll one

about core training despite having 3 trainings that fall into that category + expect(wrapper.queryAllByTestId('training-c')).to.have.length(1); + wrapper.unmount(); + }); +});