Build the Solaire inventory intelligence MVP
Some checks failed
CI / verify (push) Has been cancelled
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>
This commit is contained in:
27
tests/integrations.test.ts
Normal file
27
tests/integrations.test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user