Skip to content

Commit

Permalink
test: Move feature flag check due to rule of conditional hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Dec 5, 2024
1 parent ce93b79 commit 1cf094b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import TableContainer from "@mui/material/TableContainer";
import TableHead from "@mui/material/TableHead";
import TableRow from "@mui/material/TableRow";
import Typography from "@mui/material/Typography";
import { hasFeatureFlag } from "lib/featureFlags";
import React from "react";
import { FONT_WEIGHT_SEMI_BOLD } from "theme";

Expand Down Expand Up @@ -91,8 +90,6 @@ export const FeeBreakdown: React.FC = () => {
const breakdown = useFeeBreakdown();
if (!breakdown) return null;

if (!hasFeatureFlag("FEE_BREAKDOWN")) return null;

return (
<Box mt={3}>
<Typography variant="h3" mb={1}>
Expand Down
4 changes: 0 additions & 4 deletions editor.planx.uk/src/@planx/components/Pay/Public/Pay.test.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { PaymentStatus } from "@opensystemslab/planx-core/types";
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import { screen } from "@testing-library/react";
import { hasFeatureFlag } from "lib/featureFlags";
import { FullStore, Store, useStore } from "pages/FlowEditor/lib/store";
import React from "react";
import { act } from "react-dom/test-utils";
import * as ReactNavi from "react-navi";
import { setup } from "testUtils";
import { ApplicationPath, Breadcrumbs } from "types";
import { vi } from "vitest";
import { Mock } from "vitest";
import { axe } from "vitest-axe";

import Confirm, { Props } from "./Confirm";
Expand All @@ -27,8 +25,6 @@ vi.mock("lib/featureFlags", () => ({
hasFeatureFlag: vi.fn(),
}));

const mockHasFeatureFlag = hasFeatureFlag as Mock;

const resumeButtonText = "Resume an application you have already started";
const saveButtonText = "Save and return to this application later";

Expand Down

0 comments on commit 1cf094b

Please sign in to comment.