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>
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
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();
|
|
});
|
|
});
|