Implementa o MVP do Adaptador de Planilhas no Elo Pro.
O módulo usa a identidade Supabase, isola cada workspace e registra storage, TTL, runner e biblioteca XLSX como decisões ainda abertas. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
6e23f1533b
144 files changed
+19060
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createReadyDb, readDownSql } from "../helpers/world";
|
||||
|
||||
describe("migrations", () => {
|
||||
it("sobe do zero e o rollback remove as tabelas do módulo", async () => {
|
||||
const db = await createReadyDb();
|
||||
const tables = await db.withService((query) =>
|
||||
query.query<{ table_name: string }>(
|
||||
`select table_name from information_schema.tables where table_schema = 'public' and table_name like 'spreadsheet_%'`,
|
||||
),
|
||||
);
|
||||
expect(tables.map((row) => row.table_name).sort()).toEqual([
|
||||
"spreadsheet_adapter_settings",
|
||||
"spreadsheet_job_mappings",
|
||||
"spreadsheet_job_sources",
|
||||
"spreadsheet_jobs",
|
||||
"spreadsheet_models",
|
||||
]);
|
||||
await db.exec(await readDownSql());
|
||||
const after = await db.withService((query) =>
|
||||
query.query<{ table_name: string }>(
|
||||
`select table_name from information_schema.tables where table_schema = 'public' and table_name like 'spreadsheet_%'`,
|
||||
),
|
||||
);
|
||||
expect(after).toHaveLength(0);
|
||||
const profiles = await db.withService((query) => query.query(`select id from public.profiles`));
|
||||
expect(profiles.length).toBe(5);
|
||||
await db.close();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user