-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
11,352 additions
and
318 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
exclude: 'seed-section-base-*' | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
|
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
10,736 changes: 10,736 additions & 0 deletions
10,736
services/database/data/seed/seed-section-base-2024.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
139 changes: 139 additions & 0 deletions
139
services/ui-src/src/components/fields/SynthesizedTable.test.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,139 @@ | ||
import React from "react"; | ||
import { Provider } from "react-redux"; | ||
import { screen, render } from "@testing-library/react"; | ||
import configureMockStore from "redux-mock-store"; | ||
import { lteMask } from "../../util/constants"; | ||
import SynthesizedTable from "./SynthesizedTable"; | ||
|
||
const mockStore = configureMockStore(); | ||
const store = mockStore({ | ||
formData: [ | ||
{ | ||
contents: { | ||
section: { | ||
year: 2023, | ||
state: "AL", | ||
}, | ||
}, | ||
}, | ||
], | ||
global: { | ||
stateName: "AL", | ||
}, | ||
stateUser: { | ||
abbr: "CMS", | ||
}, | ||
enrollmentCounts: { | ||
chipEnrollments: 0, | ||
}, | ||
lastYearFormData: [], | ||
lastYearTotals: {}, | ||
}); | ||
|
||
const defaultProps = { | ||
tableTitle: "Managed Care Costs", | ||
question: { | ||
questions: [], | ||
fieldset_info: { | ||
rows: [ | ||
[ | ||
{ | ||
contents: "Eligible children", | ||
}, | ||
{ | ||
actions: ["identity"], | ||
targets: ["$..*[?(@ && @.id=='2023-05-a-03-01-a')].answer.entry"], | ||
}, | ||
{ | ||
actions: ["identity"], | ||
targets: ["$..*[?(@ && @.id=='2023-05-a-03-01-b')].answer.entry"], | ||
}, | ||
], | ||
], | ||
headers: [ | ||
{ | ||
contents: "", | ||
}, | ||
{ | ||
contents: "FFY 2023", | ||
}, | ||
{ | ||
contents: "FFY 2024", | ||
}, | ||
], | ||
}, | ||
fieldset_type: "synthesized_table", | ||
type: "fieldset", | ||
}, | ||
}; | ||
|
||
const SynthesizedTableComponentWithProps = (testSpecificProps) => { | ||
return ( | ||
<Provider store={store}> | ||
<SynthesizedTable {...defaultProps} {...testSpecificProps} /> | ||
</Provider> | ||
); | ||
}; | ||
|
||
describe("<SynthesizedTable />", () => { | ||
test("should render header and labels", () => { | ||
render(SynthesizedTableComponentWithProps()); | ||
|
||
expect(screen.getByText("FFY 2023")).toBeInTheDocument(); | ||
expect(screen.getByText("FFY 2024")).toBeInTheDocument(); | ||
expect(screen.getByText("Eligible children")).toBeInTheDocument(); | ||
}); | ||
|
||
test("should not render in print view with lessThanEleven mask prop", () => { | ||
render( | ||
SynthesizedTableComponentWithProps({ | ||
question: { | ||
...defaultProps.question, | ||
fieldset_info: { | ||
rows: [ | ||
[ | ||
{ | ||
contents: "Eligible children", | ||
mask: lteMask, | ||
}, | ||
{ | ||
mask: lteMask, | ||
actions: ["identity"], | ||
targets: [ | ||
"$..*[?(@ && @.id=='2023-05-a-03-01-a')].answer.entry", | ||
], | ||
}, | ||
{ | ||
mask: lteMask, | ||
actions: ["identity"], | ||
targets: [ | ||
"$..*[?(@ && @.id=='2023-05-a-03-01-b')].answer.entry", | ||
], | ||
}, | ||
], | ||
], | ||
headers: [ | ||
{ | ||
mask: lteMask, | ||
contents: "", | ||
}, | ||
{ | ||
mask: lteMask, | ||
contents: "FFY 2023", | ||
}, | ||
{ | ||
mask: lteMask, | ||
contents: "FFY 2024", | ||
}, | ||
], | ||
}, | ||
}, | ||
printView: true, | ||
}) | ||
); | ||
|
||
expect(screen.queryByText("FFY 2023")).not.toBeInTheDocument(); | ||
expect(screen.queryByText("FFY 2024")).not.toBeInTheDocument(); | ||
expect(screen.queryByText("Eligible children")).not.toBeInTheDocument(); | ||
}); | ||
}); |
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
Oops, something went wrong.