-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: apply taboo_xp after exceptional
- Loading branch information
Showing
2 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { beforeAll, describe, expect, it } from "vitest"; | ||
import type { StoreApi } from "zustand"; | ||
|
||
import type { StoreState } from "@/store/slices"; | ||
import { getMockStore } from "@/test/get-mock-store"; | ||
|
||
import { countExperience } from "./card-utils"; | ||
|
||
describe("countExperience", () => { | ||
let store: StoreApi<StoreState>; | ||
|
||
beforeAll(async () => { | ||
store = await getMockStore(); | ||
}); | ||
|
||
it("handles base case", () => { | ||
const card = store.getState().metadata.cards["60127"]; | ||
expect(countExperience(card, 1)).toEqual(3); | ||
}); | ||
|
||
it("handles case: chained", () => { | ||
const card = store.getState().metadata.cards["60127"]; | ||
card.taboo_xp = -1; | ||
expect(countExperience(card, 1)).toEqual(2); | ||
}); | ||
|
||
it("handles myriad", () => { | ||
const card = store.getState().metadata.cards["06328"]; | ||
expect(countExperience(card, 3)).toEqual(2); | ||
}); | ||
|
||
it("handles exceptional: base case", () => { | ||
const card = store.getState().metadata.cards["08053"]; | ||
expect(countExperience(card, 1)).toEqual(4); | ||
}); | ||
|
||
it("handles exceptional: chained", () => { | ||
const card = store.getState().metadata.cards["08053"]; | ||
card.taboo_xp = 1; | ||
expect(countExperience(card, 1)).toEqual(5); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters