mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-24 23:32:19 +10:00
Add application tracker REST and MCP parity
Add comprehensive Application Tracker REST and MCP coverage, document the MCP workflow, add Markdown/ActionLint checks, bump the release version, and fill all extracted translations.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildMcpServerCard } from "./mcp-server-card";
|
||||
import { MCP_TOOL_NAME } from "./mcp-tool-names";
|
||||
import { TOOL_META } from "./tool-meta";
|
||||
|
||||
describe("buildMcpServerCard", () => {
|
||||
const card = buildMcpServerCard("1.2.3");
|
||||
@@ -41,6 +42,15 @@ describe("buildMcpServerCard", () => {
|
||||
expect(tool?.annotations?.readOnlyHint).toBe(true);
|
||||
});
|
||||
|
||||
it("advertises application tracker tools", () => {
|
||||
const names = card.tools.map((tool) => tool.name);
|
||||
|
||||
expect(names).toContain("list_applications");
|
||||
expect(names).toContain("create_application");
|
||||
expect(names).toContain("attach_application_document");
|
||||
expect(names).toContain("tailor_resume_for_application");
|
||||
});
|
||||
|
||||
it("declares a JSON Schema input for every tool", () => {
|
||||
for (const tool of card.tools) {
|
||||
expect(tool.inputSchema, tool.name).toBeDefined();
|
||||
@@ -71,4 +81,41 @@ describe("buildMcpServerCard", () => {
|
||||
const props = card.configurationSchema.properties as Record<string, unknown>;
|
||||
expect(props.apiKey).toBeDefined();
|
||||
});
|
||||
|
||||
it("matches the create/update application archived contract", () => {
|
||||
const create = TOOL_META[MCP_TOOL_NAME.createApplication].inputSchema;
|
||||
const update = TOOL_META[MCP_TOOL_NAME.updateApplication].inputSchema;
|
||||
|
||||
expect(create.safeParse({ company: "Acme", role: "Engineer", archived: true }).success).toBe(false);
|
||||
expect(update.safeParse({ id: "app-1", archived: true }).success).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts only http/https application source URLs", () => {
|
||||
const create = TOOL_META[MCP_TOOL_NAME.createApplication].inputSchema;
|
||||
const autofill = TOOL_META[MCP_TOOL_NAME.autofillApplicationFromJob].inputSchema;
|
||||
|
||||
expect(create.safeParse({ company: "Acme", role: "Engineer", sourceUrl: "https://example.com/job" }).success).toBe(
|
||||
true,
|
||||
);
|
||||
expect(autofill.safeParse({ sourceUrl: "http://example.com/job" }).success).toBe(true);
|
||||
expect(create.safeParse({ company: "Acme", role: "Engineer", sourceUrl: "ftp://example.com/job" }).success).toBe(
|
||||
false,
|
||||
);
|
||||
expect(autofill.safeParse({ sourceUrl: "javascript:alert(1)" }).success).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects application document payloads above 10MB decoded", () => {
|
||||
const schema = TOOL_META[MCP_TOOL_NAME.attachApplicationDocument].inputSchema;
|
||||
const tooLargePdf = Buffer.alloc(10 * 1024 * 1024 + 1, 0).toString("base64");
|
||||
|
||||
expect(
|
||||
schema.safeParse({
|
||||
id: "app-1",
|
||||
kind: "resume",
|
||||
fileName: "resume.pdf",
|
||||
contentType: "application/pdf",
|
||||
dataBase64: tooLargePdf,
|
||||
}).success,
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user