-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable delivery system edit buttons, unless selected (#91)
- Loading branch information
1 parent
4e5238c
commit 35a9fea
Showing
5 changed files
with
78 additions
and
29 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
28 changes: 28 additions & 0 deletions
28
services/ui-src/src/components/report/QualityMeasureTable.test.tsx
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,28 @@ | ||
import { QualityMeasureTableElement } from "./QualityMeasureTable"; | ||
import { render, screen } from "@testing-library/react"; | ||
import { useStore } from "utils"; | ||
import { mockUseStore } from "utils/testing/setupJest"; | ||
|
||
jest.mock("utils/state/useStore"); | ||
const mockedUseStore = useStore as jest.MockedFunction<typeof useStore>; | ||
mockedUseStore.mockReturnValue({ ...mockUseStore }); | ||
|
||
jest.mock("react-hook-form", () => ({ | ||
useFormContext: jest.fn().mockReturnValue({ | ||
getValues: jest.fn().mockReturnValue({ answer: "FFS" }), | ||
}), | ||
})); | ||
|
||
describe("Quality Measure Table", () => { | ||
it("should enable each delivery system's button correctly", () => { | ||
render(<QualityMeasureTableElement />); | ||
|
||
const ffsRow = screen.getByRole("row", { name: /FFS CMIT# 960/ }); | ||
const ffsButton = ffsRow.querySelector("button"); | ||
expect(ffsButton).toBeEnabled(); | ||
|
||
const mltssRow = screen.getByRole("row", { name: /MLTSS CMIT# 960/ }); | ||
const mltssButton = mltssRow.querySelector("button"); | ||
expect(mltssButton).toBeDisabled(); | ||
}); | ||
}); |
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