Skip to content

Commit

Permalink
resolve merge conflicts & update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhanl committed Aug 9, 2023
1 parent d961a59 commit ce70d8a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 42 deletions.
78 changes: 37 additions & 41 deletions src/__tests__/MarginalTaxRates.test.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,62 @@
import { fireEvent, render, screen, within } from "@testing-library/react";
import { render, screen} from "@testing-library/react";

Check failure on line 1 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Insert `·`
import MarginalTaxRates from "pages/household/output/MarginalTaxRates";
import {
getPlotlyAxisFormat,
getValueFromHousehold,
} from "api/variables.js";
import { useSearchParams } from "react-router-dom";

Check failure on line 3 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Delete `⏎`


jest.mock("react-plotly.js", () => jest.fn());
jest.mock("../api/variables.js", () => ({
getValueFromHousehold: jest.fn(),
getPlotlyAxisFormat: jest.fn()
getValueFromHousehold: jest.fn(),
getPlotlyAxisFormat: jest.fn()

Check failure on line 9 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Insert `,`
}));
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()

Check failure on line 16 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Insert `,`
}

Check failure on line 17 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Insert `;`
});

const householdInput = {people: {

Check failure on line 20 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Insert `⏎··`
you: {
employment_income: {
"2023": {}
}
you: {

Check failure on line 21 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Insert `··`
employment_income: {

Check failure on line 22 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Insert `··`
"2023": {}

Check failure on line 23 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Replace `"2023":·{}` with `··2023:·{},`
}

Check failure on line 24 in src/__tests__/MarginalTaxRates.test.js

View workflow job for this annotation

GitHub Actions / CI (19.x)

Replace `····}` with `······},`
}
}};

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(<MarginalTaxRates householdInput={householdInput} metadata={metadata} policy={policy}/>);
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(<MarginalTaxRates householdInput={householdInput} metadata={metadata} policy={policy}/>);
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
1 change: 0 additions & 1 deletion src/pages/household/output/MarginalTaxRates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export default function MarginalTaxRates(props) {
),
tickformat: ".1%",
},
},
legend: {
// Position above the plot
y: 1.1,
Expand Down

0 comments on commit ce70d8a

Please sign in to comment.