Skip to content

Commit

Permalink
fixed mundanes magres options from locking up the app
Browse files Browse the repository at this point in the history
  • Loading branch information
dethstrobe committed Oct 27, 2020
1 parent 8d31d46 commit 6f65fba
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
27 changes: 15 additions & 12 deletions components/runner/magRes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,21 @@ export const MagRes = () => {
dispatch={dispatch}
priority={priority}
/>
{runner.magres && (
<MagResAttributeSlider
adjustmentPoints={
priorityData.metatypes[runner.priority.metatype].adjustmentPoints
}
attribute={priority[runner.magres][0]}
min={priority[runner.magres][1]}
max={6}
attributes={runner.attributes}
dispatch={dispatch}
/>
)}
{runner.magres &&
(runner.magres === "Mundane" ? (
<h1>Nothing Special Here...</h1>
) : (
<MagResAttributeSlider
adjustmentPoints={
priorityData.metatypes[runner.priority.metatype].adjustmentPoints
}
attribute={priority[runner.magres][0]}
min={priority[runner.magres][1]}
max={6}
attributes={runner.attributes}
dispatch={dispatch}
/>
))}
</>
)
}
Expand Down
12 changes: 12 additions & 0 deletions components/runner/magRes/magRes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ describe("Magic and Resonance", () => {
expect(getByText("-1/1")).toHaveClass("bad-stuff")
})
})
it("should hide this sections for mundanes", async () => {
const { getByLabelText, getByText } = setup("3")

await waitFor(() => {
getByLabelText("Mundane")
})
getByLabelText("Mundane").click()

await waitFor(() => {
expect(getByText("Nothing Special Here...")).toBeInTheDocument()
})
})
})

describe("runner priority checks", () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "oma3",
"author": "@erikdstock",
"license": "GNU 3.0",
"version": "3.2.0",
"version": "3.2.1",
"scripts": {
"dev": "next dev",
"build": "next build && next export",
Expand Down

0 comments on commit 6f65fba

Please sign in to comment.