diff --git a/src/__tests__/MarginalTaxRates.test.js b/src/__tests__/MarginalTaxRates.test.js index 5c5e4c87d..a45d2d526 100644 --- a/src/__tests__/MarginalTaxRates.test.js +++ b/src/__tests__/MarginalTaxRates.test.js @@ -1,66 +1,62 @@ -import { fireEvent, render, screen, within } from "@testing-library/react"; +import { render, screen} from "@testing-library/react"; import MarginalTaxRates from "pages/household/output/MarginalTaxRates"; -import { - getPlotlyAxisFormat, - getValueFromHousehold, - } from "api/variables.js"; import { useSearchParams } from "react-router-dom"; jest.mock("react-plotly.js", () => jest.fn()); jest.mock("../api/variables.js", () => ({ - getValueFromHousehold: jest.fn(), - getPlotlyAxisFormat: jest.fn() + getValueFromHousehold: jest.fn(), + getPlotlyAxisFormat: jest.fn() })); jest.mock("react-router-dom", () => { - const originalModule = jest.requireActual("react-router-dom"); - return { - __esModule: true, - ...originalModule, - useSearchParams: jest.fn() - } + const originalModule = jest.requireActual("react-router-dom"); + return { + __esModule: true, + ...originalModule, + useSearchParams: jest.fn() + } }); const householdInput = {people: { - you: { - employment_income: { - "2023": {} - } + you: { + employment_income: { + "2023": {} } + } }}; const metadata = { - countryId: "us" + countryId: "us" } const policy = { - baseline: { - data: {} - }, - reform: { - data: {} - } + baseline: { + data: {} + }, + reform: { + data: {} + } } describe("Test Render Output", () => { - test("Should render description", () => { - useSearchParams.mockImplementation(() => { - const get = (param) => { - if (param === "focus") { - return "householdOutput.mtr" - } else if (param === "reform") { - return "13870" - } else if (param === "baseline") { - return "13867" - } else if (param === "household") { - return "33253" - } - } - return [{get}]; - }); - render(); - expect(screen.getByText("This chart shows how your net income changes under different earnings. It is based on your household's current situation.")).toBeTruthy(); + test("Should render description", () => { + useSearchParams.mockImplementation(() => { + const get = (param) => { + if (param === "focus") { + return "householdOutput.mtr" + } else if (param === "reform") { + return "13870" + } else if (param === "baseline") { + return "13867" + } else if (param === "household") { + return "33253" + } + } + return [{get}]; }); + render(); + expect(screen.getByText("This chart shows how your net income changes under different earnings. It is based on your household's current situation.")).toBeTruthy(); + }); }); //TODO: Either render plots here or in own test files for validation \ No newline at end of file diff --git a/src/pages/household/output/MarginalTaxRates.jsx b/src/pages/household/output/MarginalTaxRates.jsx index 754879e2c..17610ad4d 100644 --- a/src/pages/household/output/MarginalTaxRates.jsx +++ b/src/pages/household/output/MarginalTaxRates.jsx @@ -170,7 +170,6 @@ export default function MarginalTaxRates(props) { ), tickformat: ".1%", }, - }, legend: { // Position above the plot y: 1.1,