chore: full stack stability and migration fixes, plus react UI progress
This commit is contained in:
@@ -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" } })
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user