-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Poulter/APPEALS-46624-react-18-upgrade-final' into Poul…
…ter/46624-react-18-upgrade-10-23
- Loading branch information
Showing
193 changed files
with
36,087 additions
and
1,091,182 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
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
134 changes: 115 additions & 19 deletions
134
client/app/components/badges/ContestedBadge/__snapshots__/ContestedClaimBadge.test.js.snap
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,23 +1,119 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ContestedClaimBadge renders correctly 1`] = ` | ||
<Provider | ||
store={ | ||
Object { | ||
"dispatch": [Function], | ||
"getState": [Function], | ||
"replaceReducer": [Function], | ||
"subscribe": [Function], | ||
Symbol(observable): [Function], | ||
} | ||
} | ||
> | ||
<ContestedClaimBadge | ||
appeal={ | ||
Object { | ||
"contested_claim": true, | ||
} | ||
} | ||
/> | ||
</Provider> | ||
<DocumentFragment> | ||
<div | ||
class="cf-contested-badge" | ||
> | ||
<span | ||
aria-describedby="badge-cc-1234" | ||
aria-label="contested claim" | ||
currentitem="false" | ||
data-css-j1ndum="" | ||
data-event="focus mouseenter" | ||
data-event-off="mouseleave keydown" | ||
data-for="badge-cc-1234" | ||
data-tip="true" | ||
tabindex="0" | ||
> | ||
CC | ||
</span> | ||
<span | ||
data-css-s9vlzg="" | ||
data-testid="tooltip-testid" | ||
> | ||
<div | ||
class="__react_component_tooltip t00000000-0000-0000-0000-000000000000 place-bottom type-dark" | ||
data-id="tooltip" | ||
id="badge-cc-1234" | ||
role="tooltip" | ||
> | ||
<style> | ||
.t00000000-0000-0000-0000-000000000000 { | ||
color: #fff; | ||
background: #222; | ||
border: 1px solid transparent; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-top { | ||
margin-top: -10px; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-top::before { | ||
border-top: 8px solid transparent; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-top::after { | ||
border-left: 8px solid transparent; | ||
border-right: 8px solid transparent; | ||
bottom: -6px; | ||
left: 50%; | ||
margin-left: -8px; | ||
border-top-color: #222; | ||
border-top-style: solid; | ||
border-top-width: 6px; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-bottom { | ||
margin-top: 10px; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-bottom::before { | ||
border-bottom: 8px solid transparent; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-bottom::after { | ||
border-left: 8px solid transparent; | ||
border-right: 8px solid transparent; | ||
top: -6px; | ||
left: 50%; | ||
margin-left: -8px; | ||
border-bottom-color: #222; | ||
border-bottom-style: solid; | ||
border-bottom-width: 6px; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-left { | ||
margin-left: -10px; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-left::before { | ||
border-left: 8px solid transparent; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-left::after { | ||
border-top: 5px solid transparent; | ||
border-bottom: 5px solid transparent; | ||
right: -6px; | ||
top: 50%; | ||
margin-top: -4px; | ||
border-left-color: #222; | ||
border-left-style: solid; | ||
border-left-width: 6px; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-right { | ||
margin-left: 10px; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-right::before { | ||
border-right: 8px solid transparent; | ||
} | ||
.t00000000-0000-0000-0000-000000000000.place-right::after { | ||
border-top: 5px solid transparent; | ||
border-bottom: 5px solid transparent; | ||
left: -6px; | ||
top: 50%; | ||
margin-top: -4px; | ||
border-right-color: #222; | ||
border-right-style: solid; | ||
border-right-width: 6px; | ||
} | ||
</style> | ||
<div | ||
style="white-space: pre-line;" | ||
> | ||
This is a Contested Claim and needs to be | ||
processed by the Specialty Case team. Please | ||
include all parties and POA in correspondence. | ||
</div> | ||
</div> | ||
</span> | ||
</div> | ||
</DocumentFragment> | ||
`; |
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,34 +1,54 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { render, screen, waitFor } from '@testing-library/react'; | ||
import thunk from 'redux-thunk'; | ||
import { Provider } from 'react-redux'; | ||
import { createStore, applyMiddleware } from 'redux'; | ||
|
||
import rootReducer from 'app/queue/reducers'; | ||
import FnodBadge from './FnodBadge'; | ||
import { tooltipListStyling } from 'app/components/badges/style'; | ||
import { DateString } from 'app/util/DateUtil'; | ||
import COPY from 'COPY'; | ||
import Badge from '../Badge'; | ||
|
||
describe('FnodBadge', () => { | ||
const defaultAppeal = { | ||
veteranAppellantDeceased: true, | ||
veteranDateOfDeath: '2019-03-17' | ||
}; | ||
|
||
const veteranAppellantDeceased = true; | ||
const uniqueId = '1234' | ||
const veteranDateOfDeath = '2019-03-17'; | ||
const tooltipText = <div> | ||
<strong>Date of Death Reported</strong> | ||
<ul {...tooltipListStyling}> | ||
<li><strong>Source:</strong> {COPY.FNOD_SOURCE}</li> | ||
{veteranDateOfDeath && | ||
<li><strong>Date of Death:</strong> <DateString date={veteranDateOfDeath} /></li> | ||
} | ||
</ul> | ||
</div>; | ||
|
||
const getStore = () => createStore(rootReducer, applyMiddleware(thunk)); | ||
|
||
const setupFnodBadge = (store) => { | ||
return mount( | ||
return ( | ||
<Provider store={store}> | ||
<FnodBadge | ||
appeal={defaultAppeal} | ||
uniqueId={uniqueId} | ||
veteranAppellantDeceased={veteranAppellantDeceased} | ||
tooltipText={tooltipText} | ||
/> | ||
</Provider> | ||
); | ||
}; | ||
|
||
it('renders correctly', () => { | ||
it.only('renders correctly', () => { | ||
const store = getStore(); | ||
const component = setupFnodBadge(store); | ||
const { asFragment } = render(setupFnodBadge(store)); | ||
|
||
expect(component).toMatchSnapshot(); | ||
expect(screen.getByText('FNOD')).toBeInTheDocument(); | ||
expect(screen.getByText('Date of Death Reported')).toBeInTheDocument() | ||
expect(screen.getByText('Source:')).toBeInTheDocument(); | ||
expect(screen.getByText('Date of Death:')).toBeInTheDocument(); | ||
expect(screen.getByText('03/17/19')).toBeInTheDocument(); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.