chore: full stack stability and migration fixes, plus react UI progress
Some checks failed
CI / podman-build (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-03-18 09:01:38 +02:00
parent 38cab8c246
commit a66d908eff
142 changed files with 12210 additions and 3402 deletions

View File

@@ -1,5 +1,9 @@
import { describe, it, expect } from 'vitest';
import { createMockedFunction } from './test-utils';
import dotenv from 'dotenv';
import path from 'path';
dotenv.config({ path: path.resolve(process.cwd(), '../../.env') });
describe('Edge Functions', () => {
const functionName = `hello-world-${Date.now()}`;
@@ -48,7 +52,7 @@ describe('Edge Functions', () => {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MADBASE_ANON_KEY}`
'Authorization': `Bearer ${process.env.MADBASE_SERVICE_ROLE_KEY}`
},
body: JSON.stringify({ payload: { name: 'World' } })
});
@@ -96,7 +100,7 @@ describe('Edge Functions', () => {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MADBASE_ANON_KEY}`
'Authorization': `Bearer ${process.env.MADBASE_SERVICE_ROLE_KEY}`
},
body: JSON.stringify({ payload: { name: 'World' } })
});
@@ -140,9 +144,9 @@ describe('Edge Functions', () => {
// Invoke
const res = await fetch(`${process.env.MADBASE_URL}/functions/v1/${name}`, {
method: 'POST',
headers: {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MADBASE_ANON_KEY}`
'Authorization': `Bearer ${process.env.MADBASE_SERVICE_ROLE_KEY}`
},
body: JSON.stringify({ payload: {} })
});
@@ -181,9 +185,9 @@ describe('Edge Functions', () => {
// Invoke (Missing Field)
const res = await fetch(`${process.env.MADBASE_URL}/functions/v1/${name}`, {
method: 'POST',
headers: {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MADBASE_ANON_KEY}`
'Authorization': `Bearer ${process.env.MADBASE_SERVICE_ROLE_KEY}`
},
body: JSON.stringify({ payload: {} })
});
@@ -230,9 +234,9 @@ describe('Edge Functions', () => {
const res = await fetch(`${process.env.MADBASE_URL}/functions/v1/${name}`, {
method: 'POST',
headers: {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MADBASE_ANON_KEY}`
'Authorization': `Bearer ${process.env.MADBASE_SERVICE_ROLE_KEY}`
},
body: JSON.stringify({ payload: {} })
});
@@ -285,9 +289,9 @@ describe('Edge Functions', () => {
const res = await fetch(`${process.env.MADBASE_URL}/functions/v1/${name}`, {
method: 'POST',
headers: {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MADBASE_ANON_KEY}`
'Authorization': `Bearer ${process.env.MADBASE_SERVICE_ROLE_KEY}`
},
body: JSON.stringify({ payload: { email: "newuser@example.com" } })
});
@@ -409,7 +413,7 @@ describe('Edge Functions', () => {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MADBASE_ANON_KEY}`
'Authorization': `Bearer ${process.env.MADBASE_SERVICE_ROLE_KEY}`
},
body: JSON.stringify({ payload: { productId: "prod_123", successUrl: "http://example.com" } })
});