mirror of
https://github.com/willchen96/mike.git
synced 2026-07-24 23:41:04 +02:00
fix stack test database initialization
This commit is contained in:
parent
6aed350a3c
commit
9399fce86d
3 changed files with 49 additions and 4 deletions
|
|
@ -28,7 +28,7 @@ maybeDescribe("Supabase access integration", () => {
|
|||
const privateDocId = crypto.randomUUID();
|
||||
|
||||
try {
|
||||
await admin.from("projects").insert([
|
||||
const projectsInsert = await admin.from("projects").insert([
|
||||
{
|
||||
id: sharedProjectId,
|
||||
user_id: ownerId,
|
||||
|
|
@ -42,9 +42,16 @@ maybeDescribe("Supabase access integration", () => {
|
|||
shared_with: [],
|
||||
},
|
||||
]);
|
||||
if (projectsInsert.error) {
|
||||
throw new Error(
|
||||
`Could not seed projects: ${projectsInsert.error.message}`,
|
||||
{ cause: projectsInsert.error },
|
||||
);
|
||||
}
|
||||
|
||||
// filename/file_type live on document_versions in this schema —
|
||||
// the documents rows only need identity + ownership columns.
|
||||
await admin.from("documents").insert([
|
||||
const documentsInsert = await admin.from("documents").insert([
|
||||
{
|
||||
id: sharedDocId,
|
||||
user_id: ownerId,
|
||||
|
|
@ -56,6 +63,12 @@ maybeDescribe("Supabase access integration", () => {
|
|||
project_id: privateProjectId,
|
||||
},
|
||||
]);
|
||||
if (documentsInsert.error) {
|
||||
throw new Error(
|
||||
`Could not seed documents: ${documentsInsert.error.message}`,
|
||||
{ cause: documentsInsert.error },
|
||||
);
|
||||
}
|
||||
|
||||
await expect(
|
||||
listAccessibleProjectIds(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue