rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61)
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61) Co-authored-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com> Co-committed-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
This commit was merged in pull request #61.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { SystemRole } from "@capakraken/shared";
|
||||
import { SystemRole } from "@nexus/shared";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { effortRuleRouter } from "../router/effort-rule.js";
|
||||
import { createCallerFactory } from "../trpc.js";
|
||||
|
||||
// Mock the engine — we focus on the router/DB layer, not the pure engine logic
|
||||
vi.mock("@capakraken/engine", () => ({
|
||||
vi.mock("@nexus/engine", () => ({
|
||||
expandScopeToEffort: vi.fn().mockReturnValue({
|
||||
lines: [
|
||||
{
|
||||
@@ -91,7 +91,10 @@ function sampleRuleSet(overrides: Record<string, unknown> = {}) {
|
||||
|
||||
describe("effortRule.list", () => {
|
||||
it("returns rule sets ordered by isDefault desc, name asc", async () => {
|
||||
const sets = [sampleRuleSet(), sampleRuleSet({ id: "ers_2", name: "Animation", isDefault: false })];
|
||||
const sets = [
|
||||
sampleRuleSet(),
|
||||
sampleRuleSet({ id: "ers_2", name: "Animation", isDefault: false }),
|
||||
];
|
||||
const db = {
|
||||
effortRuleSet: {
|
||||
findMany: vi.fn().mockResolvedValue(sets),
|
||||
@@ -136,7 +139,9 @@ describe("effortRule.getById", () => {
|
||||
};
|
||||
|
||||
const caller = createControllerCaller(db);
|
||||
await expect(caller.getById({ id: "nonexistent" })).rejects.toThrow("Effort rule set not found");
|
||||
await expect(caller.getById({ id: "nonexistent" })).rejects.toThrow(
|
||||
"Effort rule set not found",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -246,8 +251,20 @@ describe("effortRule.update", () => {
|
||||
await caller.update({
|
||||
id: "ers_1",
|
||||
rules: [
|
||||
{ scopeType: "shot", discipline: "Lighting", unitMode: "per_frame", hoursPerUnit: 0.1, sortOrder: 0 },
|
||||
{ scopeType: "asset", discipline: "Modeling", unitMode: "per_item", hoursPerUnit: 8, sortOrder: 1 },
|
||||
{
|
||||
scopeType: "shot",
|
||||
discipline: "Lighting",
|
||||
unitMode: "per_frame",
|
||||
hoursPerUnit: 0.1,
|
||||
sortOrder: 0,
|
||||
},
|
||||
{
|
||||
scopeType: "asset",
|
||||
discipline: "Modeling",
|
||||
unitMode: "per_item",
|
||||
hoursPerUnit: 8,
|
||||
sortOrder: 1,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -271,7 +288,9 @@ describe("effortRule.update", () => {
|
||||
};
|
||||
|
||||
const caller = createManagerCaller(db);
|
||||
await expect(caller.update({ id: "nonexistent", name: "X" })).rejects.toThrow("Effort rule set not found");
|
||||
await expect(caller.update({ id: "nonexistent", name: "X" })).rejects.toThrow(
|
||||
"Effort rule set not found",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -357,7 +376,9 @@ describe("effortRule.preview", () => {
|
||||
};
|
||||
|
||||
const caller = createControllerCaller(db);
|
||||
await expect(caller.preview({ estimateId: "nope", ruleSetId: "ers_1" })).rejects.toThrow("Estimate not found");
|
||||
await expect(caller.preview({ estimateId: "nope", ruleSetId: "ers_1" })).rejects.toThrow(
|
||||
"Estimate not found",
|
||||
);
|
||||
});
|
||||
|
||||
it("throws NOT_FOUND when rule set does not exist", async () => {
|
||||
@@ -368,7 +389,9 @@ describe("effortRule.preview", () => {
|
||||
};
|
||||
|
||||
const caller = createControllerCaller(db);
|
||||
await expect(caller.preview({ estimateId: "est_1", ruleSetId: "nope" })).rejects.toThrow("Effort rule set not found");
|
||||
await expect(caller.preview({ estimateId: "est_1", ruleSetId: "nope" })).rejects.toThrow(
|
||||
"Effort rule set not found",
|
||||
);
|
||||
});
|
||||
|
||||
it("throws NOT_FOUND when estimate has no versions", async () => {
|
||||
@@ -380,7 +403,9 @@ describe("effortRule.preview", () => {
|
||||
};
|
||||
|
||||
const caller = createControllerCaller(db);
|
||||
await expect(caller.preview({ estimateId: "est_1", ruleSetId: "ers_1" })).rejects.toThrow("Estimate has no versions");
|
||||
await expect(caller.preview({ estimateId: "est_1", ruleSetId: "ers_1" })).rejects.toThrow(
|
||||
"Estimate has no versions",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user