Keep the profile lock to the shown and waiting card ids, so a moved pick still fails without storing why each card won.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
bcbc6f30d9
commit
c569482706
2 files changed
+130
-27903
No files matched your search
Vendored
+126
-27880
File diff suppressed because it is too large.
Load diff
@@ -2,7 +2,7 @@ import { readFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { DECK_IDS } from "../../lib/create/deckTypes";
|
||||
import type { DeckId, RecommendedCard } from "../../lib/create/deckTypes";
|
||||
import type { DeckId } from "../../lib/create/deckTypes";
|
||||
import { deckData, recommendDeck } from "../../lib/create/deckRecommend";
|
||||
import { variantsOf } from "../../lib/create/reviewProfiles";
|
||||
import type { ReviewProfile } from "../../lib/create/reviewProfiles";
|
||||
@@ -19,25 +19,6 @@ function readJson<T>(rel: string): T {
|
||||
const profiles = readJson<ReviewProfile[]>("data/create/profiles/real-group-profiles.json");
|
||||
const founders = readJson<ReviewProfile[]>("data/create/profiles/one-member-founders.json");
|
||||
|
||||
function compact(card: RecommendedCard) {
|
||||
const reason =
|
||||
card.reason.kind === "added"
|
||||
? `added:${card.reason.answer}`
|
||||
: card.reason.kind === "opened"
|
||||
? `opened:${card.reason.answer}`
|
||||
: card.reason.answer
|
||||
? `fit+${card.reason.answer}`
|
||||
: "fit";
|
||||
return {
|
||||
id: card.id,
|
||||
tag: card.tag,
|
||||
tier: card.tier,
|
||||
reason,
|
||||
...(card.decidedBy ? { decidedBy: card.decidedBy } : {}),
|
||||
...(card.alternative ? { alternative: card.alternative } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
function picksFor(set: ReviewProfile[]) {
|
||||
return set.flatMap(variantsOf).map((variant) => ({
|
||||
profile: variant.profile,
|
||||
@@ -48,7 +29,7 @@ function picksFor(set: ReviewProfile[]) {
|
||||
return [
|
||||
deck,
|
||||
{
|
||||
shown: result.shown.map(compact),
|
||||
shown: result.shown.map((card) => card.id),
|
||||
waiting: result.waiting.map((card) => card.id),
|
||||
},
|
||||
];
|
||||
@@ -110,8 +91,8 @@ function chosenCards(documentKey: string): { total: number; ids: string[] } {
|
||||
|
||||
describe("real-group profiles", () => {
|
||||
it("matches the reviewed 2 Nov package run", () => {
|
||||
const expected = readJson<{ picks: unknown[] }>("tests/fixtures/profiles-picks.json");
|
||||
expect(picksFor([...profiles, ...founders])).toEqual(expected.picks);
|
||||
const expected = readJson<unknown[]>("tests/fixtures/profiles-picks.json");
|
||||
expect(picksFor([...profiles, ...founders])).toEqual(expected);
|
||||
});
|
||||
|
||||
it("reports how often row order settled a pick", () => {
|
||||
|
||||
Reference in new issue
Block a user