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,5 +1,5 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { PermissionKey, SystemRole } from "@capakraken/shared";
|
||||
import { PermissionKey, SystemRole } from "@nexus/shared";
|
||||
|
||||
import {
|
||||
createProject,
|
||||
@@ -14,7 +14,8 @@ describe("assistant project admin update tools", () => {
|
||||
|
||||
it("routes project updates through the real project router path and resolves short codes before updating", async () => {
|
||||
const auditCreate = vi.fn().mockResolvedValue({ id: "audit_1" });
|
||||
const projectFindUnique = vi.fn()
|
||||
const projectFindUnique = vi
|
||||
.fn()
|
||||
.mockResolvedValueOnce(null)
|
||||
.mockResolvedValueOnce(createProject())
|
||||
.mockResolvedValueOnce(createProject({ dynamicFields: {}, blueprintId: null }));
|
||||
@@ -59,18 +60,22 @@ describe("assistant project admin update tools", () => {
|
||||
ctx,
|
||||
);
|
||||
|
||||
expect(JSON.parse(result.content)).toEqual(expect.objectContaining({
|
||||
success: true,
|
||||
message: "Updated project Project One Reloaded (PROJ-1)",
|
||||
updatedFields: ["name", "responsiblePerson"],
|
||||
}));
|
||||
expect(projectUpdate).toHaveBeenCalledWith(expect.objectContaining({
|
||||
where: { id: "project_1" },
|
||||
data: expect.objectContaining({
|
||||
name: "Project One Reloaded",
|
||||
responsiblePerson: "Peter Parker",
|
||||
expect(JSON.parse(result.content)).toEqual(
|
||||
expect.objectContaining({
|
||||
success: true,
|
||||
message: "Updated project Project One Reloaded (PROJ-1)",
|
||||
updatedFields: ["name", "responsiblePerson"],
|
||||
}),
|
||||
}));
|
||||
);
|
||||
expect(projectUpdate).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
where: { id: "project_1" },
|
||||
data: expect.objectContaining({
|
||||
name: "Project One Reloaded",
|
||||
responsiblePerson: "Peter Parker",
|
||||
}),
|
||||
}),
|
||||
);
|
||||
expect(auditCreate).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
@@ -78,7 +83,8 @@ describe("assistant project admin update tools", () => {
|
||||
const ctx = createToolContext(
|
||||
{
|
||||
project: {
|
||||
findUnique: vi.fn()
|
||||
findUnique: vi
|
||||
.fn()
|
||||
.mockResolvedValueOnce(null)
|
||||
.mockResolvedValueOnce(createProject())
|
||||
.mockResolvedValueOnce(createProject({ dynamicFields: {}, blueprintId: null })),
|
||||
@@ -114,9 +120,7 @@ describe("assistant project admin update tools", () => {
|
||||
const ctx = createToolContext(
|
||||
{
|
||||
project: {
|
||||
findUnique: vi.fn()
|
||||
.mockResolvedValueOnce(null)
|
||||
.mockResolvedValueOnce(createProject()),
|
||||
findUnique: vi.fn().mockResolvedValueOnce(null).mockResolvedValueOnce(createProject()),
|
||||
findFirst: vi.fn().mockResolvedValue(null),
|
||||
update: projectUpdate,
|
||||
},
|
||||
@@ -127,11 +131,7 @@ describe("assistant project admin update tools", () => {
|
||||
},
|
||||
);
|
||||
|
||||
const result = await executeTool(
|
||||
"update_project",
|
||||
JSON.stringify({ id: "PROJ-1" }),
|
||||
ctx,
|
||||
);
|
||||
const result = await executeTool("update_project", JSON.stringify({ id: "PROJ-1" }), ctx);
|
||||
|
||||
expect(JSON.parse(result.content)).toEqual({
|
||||
error: "No fields to update",
|
||||
@@ -144,9 +144,7 @@ describe("assistant project admin update tools", () => {
|
||||
const ctx = createToolContext(
|
||||
{
|
||||
project: {
|
||||
findUnique: vi.fn()
|
||||
.mockResolvedValueOnce(null)
|
||||
.mockResolvedValueOnce(createProject()),
|
||||
findUnique: vi.fn().mockResolvedValueOnce(null).mockResolvedValueOnce(createProject()),
|
||||
findFirst: vi.fn().mockResolvedValue(null),
|
||||
update: projectUpdate,
|
||||
},
|
||||
@@ -168,7 +166,8 @@ describe("assistant project admin update tools", () => {
|
||||
);
|
||||
|
||||
expect(JSON.parse(result.content)).toEqual({
|
||||
error: 'No active resource found matching "Mary Jane". The responsible person must be an existing resource.',
|
||||
error:
|
||||
'No active resource found matching "Mary Jane". The responsible person must be an existing resource.',
|
||||
});
|
||||
expect(projectUpdate).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user