Some checks failed
CI / verify (push) Has been cancelled
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>
28 lines
1.0 KiB
TypeScript
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);
|
|
});
|
|
});
|