Files
Solaire/tests/integrations.test.ts
oceans2alaska 135be480e5
Some checks failed
CI / verify (push) Has been cancelled
Build the Solaire inventory intelligence MVP
Add the tenant-ready dashboard, freshness and pricing analytics, mock integration adapters, persistence schema, and verification tooling needed for the initial pilot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:16:52 -07:00

28 lines
1.0 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { getDashboardData } from "@/domain/analytics";
import { runDemoSync } from "@/integrations/sync";
describe("mock integration sync", () => {
it("normalizes Odoo and Salesforce fixtures", async () => {
const [odoo, salesforce] = await Promise.all([
runDemoSync("odoo"),
runDemoSync("salesforce"),
]);
expect(odoo.status).toBe("succeeded");
expect(salesforce.status).toBe("succeeded");
expect(odoo.recordsWritten).toBeGreaterThan(0);
expect(salesforce.recordsWritten).toBeGreaterThan(odoo.recordsWritten);
});
it("keeps all demo data inside the pilot tenant", () => {
const data = getDashboardData();
expect(data.inventory.every((item) => item.organizationId === data.organization.id)).toBe(true);
});
it("is idempotent for repeated fixture reads", async () => {
const first = await runDemoSync("odoo");
const second = await runDemoSync("odoo");
expect(second.recordsWritten).toBe(first.recordsWritten);
});
});