Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #753 from MeasureAuthoringTool/MAT-7830_RemoveFeat…
Browse files Browse the repository at this point in the history
…ureFlags

MAT-7830: Remove ShiftTestCasesDates
  • Loading branch information
gregory-akins authored Nov 4, 2024
2 parents 9e0c036 + de99530 commit 034ecbc
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 94 deletions.
1 change: 0 additions & 1 deletion src/components/routes/qdm/TestCaseRoutes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ jest.mock("@madie/madie-util", () => ({
},
useFeatureFlags: jest.fn().mockImplementation(() => ({
applyDefaults: false,
ShiftTestCasesDates: true,
})),
useOktaTokens: () => ({
getAccessToken: () => "test.jwt",
Expand Down
12 changes: 4 additions & 8 deletions src/components/routes/qdm/TestCaseRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,10 @@ const TestCaseRoutes = () => {
path="/measures/:measureId/edit/test-cases/list-page/expansion"
element={<TestCaseLandingWrapper qdm children={<Expansion />} />}
/>
{featureFlags?.ShiftTestCasesDates && (
<Route
path="/measures/:measureId/edit/test-cases/list-page/test-case-data"
element={
<TestCaseLandingWrapper qdm children={<TestCaseData />} />
}
/>
)}
<Route
path="/measures/:measureId/edit/test-cases/list-page/test-case-data"
element={<TestCaseLandingWrapper qdm children={<TestCaseData />} />}
/>
<Route
index
element={
Expand Down
17 changes: 6 additions & 11 deletions src/components/routes/qiCore/TestCaseRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,12 @@ const TestCaseRoutes = () => {
/>
}
/>
{featureFlags?.ShiftTestCasesDates && (
<Route
path="/measures/:measureId/edit/test-cases/list-page/test-case-data"
element={
<TestCaseLandingWrapper
qdm={false}
children={<TestCaseData />}
/>
}
/>
)}
<Route
path="/measures/:measureId/edit/test-cases/list-page/test-case-data"
element={
<TestCaseLandingWrapper qdm={false} children={<TestCaseData />} />
}
/>
</Route>

<Route
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("TestCase component", () => {
);

expect(screen.getByRole("navigation")).toBeInTheDocument();
expect(screen.getAllByRole("tab").length).toEqual(2);
expect(screen.getAllByRole("tab").length).toEqual(3);
const activeLink = screen.getByRole("tab", {
name: "Population Criteria 2",
});
Expand Down
114 changes: 54 additions & 60 deletions src/components/testCaseLanding/common/TestCaseListSideBarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ const TestCaseListSideBarNav = ({
qdm,
}: TestCaseListSideBarNavProps) => {
const featureFlags = useFeatureFlags();
const showConfigurationSection =
(!qdm && featureFlags?.ShiftTestCasesDates) || qdm;

let navigate = useNavigate();
const { measureId, criteriaId } = useParams<{
measureId: string;
Expand Down Expand Up @@ -96,68 +95,63 @@ const TestCaseListSideBarNav = ({
)}
</Tabs>
)}
<>
<div className="nav-collapse-container">
<button
className="nav-collapser-title"
onClick={() => {
setShowConfigTabs(!showConfigTabs);
}}
data-testid="qdm-nav-collapser"
id="qdm-nav-collapser"
tw="px-2"
>
Configuration
<span className="tab-dropdown">
{showConfigTabs ? <ExpandLessIcon /> : <ExpandMoreIcon />}
</span>
</button>
</div>

{showConfigurationSection && (
<>
<div className="nav-collapse-container">
<button
className="nav-collapser-title"
onClick={() => {
setShowConfigTabs(!showConfigTabs);
}}
data-testid="qdm-nav-collapser"
id="qdm-nav-collapser"
tw="px-2"
>
Configuration
<span className="tab-dropdown">
{showConfigTabs ? <ExpandLessIcon /> : <ExpandMoreIcon />}
</span>
</button>
</div>

{showConfigTabs && (
<Tabs
{showConfigTabs && (
<Tabs
type="C"
size="standard"
orientation="vertical"
onChange={handleChange}
value={endRoute}
>
{qdm && (
<Tab
label="SDE"
value="sde"
data-testid="nav-link-sde"
type="C"
orientation="vertical"
onChange={handleChange}
/>
)}
{qdm && (
<Tab
label="Expansion"
value="expansion"
data-testid="nav-link-expansion"
type="C"
orientation="vertical"
onChange={handleChange}
/>
)}
<Tab
label="Test Case Data"
value="test-case-data"
data-testid="test-case-data"
type="C"
size="standard"
orientation="vertical"
onChange={handleChange}
value={endRoute}
>
{qdm && (
<Tab
label="SDE"
value="sde"
data-testid="nav-link-sde"
type="C"
orientation="vertical"
onChange={handleChange}
/>
)}
{qdm && (
<Tab
label="Expansion"
value="expansion"
data-testid="nav-link-expansion"
type="C"
orientation="vertical"
onChange={handleChange}
/>
)}
{featureFlags?.ShiftTestCasesDates && (
<Tab
label="Test Case Data"
value="test-case-data"
data-testid="test-case-data"
type="C"
orientation="vertical"
onChange={handleChange}
/>
)}
</Tabs>
)}
</>
)}
/>
</Tabs>
)}
</>
</Nav>
</OuterWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ let mockApplyDefaults = false;
jest.mock("@madie/madie-util", () => ({
useFeatureFlags: jest.fn().mockImplementation(() => ({
applyDefaults: mockApplyDefaults,
ShiftTestCasesDates: true,
TestCaseID: false,
})),
}));
Expand Down Expand Up @@ -345,7 +344,6 @@ describe("TestCase component", () => {
const exportTestCase = jest.fn();
const onCloneTestCase = jest.fn();
(useFeatureFlags as jest.Mock).mockClear().mockImplementation(() => ({
ShiftTestCasesDates: true,
TestCaseID: false,
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const TestCaseTablePopover = (props: TestCaseTablePopoverProps) => {
</>
)}

{canEdit && featureFlags?.ShiftTestCasesDates && (
{canEdit && (
<button
id={`shift-dates-btn-${selectedTestCase?.id}`}
aria-label={`shift-dates-${selectedTestCase?.title}`}
Expand Down
12 changes: 3 additions & 9 deletions src/components/testCaseLanding/qdm/TestCaseList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3280,9 +3280,7 @@ describe("TestCaseList component", () => {
});

it("should render shift test case dates dialogue on Test Case list page when shift test case dates button is clicked", async () => {
(useFeatureFlags as jest.Mock).mockClear().mockImplementation(() => ({
ShiftTestCasesDates: true,
}));
(useFeatureFlags as jest.Mock).mockClear().mockImplementation(() => ({}));

const { getByTestId } = renderTestCaseListComponent();
await waitFor(() => {
Expand All @@ -3301,9 +3299,7 @@ describe("TestCaseList component", () => {

it("should shift test case dates successfully", async () => {
testCases[0].title = "WhenAllGood";
(useFeatureFlags as jest.Mock).mockClear().mockImplementation(() => ({
ShiftTestCasesDates: true,
}));
(useFeatureFlags as jest.Mock).mockClear().mockImplementation(() => ({}));
const responseDto: TestCase = {
id: "1234",
json: "date2",
Expand Down Expand Up @@ -3357,9 +3353,7 @@ describe("TestCaseList component", () => {
});

it("should handle shift test case dates failure", async () => {
(useFeatureFlags as jest.Mock).mockClear().mockImplementation(() => ({
ShiftTestCasesDates: true,
}));
(useFeatureFlags as jest.Mock).mockClear().mockImplementation(() => ({}));
const shiftTestCaseDatesApiMock = jest.fn().mockRejectedValueOnce(null);
useTestCaseServiceMock.mockImplementationOnce(() => {
return {
Expand Down
1 change: 0 additions & 1 deletion src/types/madie-madie-util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ declare module "@madie/madie-util" {
qiCoreBonnieTestCases: boolean;
qiCoreElementsTab: boolean;
qdmHideJson: boolean;
ShiftTestCasesDates: boolean;
TestCaseListSearch: boolean;
TestCaseID: boolean;
}
Expand Down

0 comments on commit 034ecbc

Please sign in to comment.