pull/715/head
Travis Fischer 2025-06-05 03:13:53 +07:00
rodzic eed94f42b4
commit 422f477cca
4 zmienionych plików z 11 dodań i 9 usunięć

Wyświetl plik

@ -9,7 +9,6 @@ DATABASE_URL=
SENTRY_DSN= SENTRY_DSN=
STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY= STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET= STRIPE_WEBHOOK_SECRET=

Wyświetl plik

@ -21,7 +21,7 @@ export const authRouter = issuer({
ttl: { ttl: {
access: 60 * 60 * 24 * 30, // 30 days access: 60 * 60 * 24 * 30, // 30 days
refresh: 60 * 60 * 24 * 365 // 1 year refresh: 60 * 60 * 24 * 365 // 1 year
// Used for creating longer-lived testing tokens // Used for creating longer-lived tokens for testing
// access: 60 * 60 * 24 * 366, // 1 year // access: 60 * 60 * 24 * 366, // 1 year
// refresh: 60 * 60 * 24 * 365 * 5 // 5 years // refresh: 60 * 60 * 24 * 365 * 5 // 5 years
}, },
@ -60,7 +60,6 @@ export const authRouter = issuer({
login_title: 'Welcome to Agentic' login_title: 'Welcome to Agentic'
}, },
sendCode: async (email, code) => { sendCode: async (email, code) => {
// TODO: Send email code to user
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log('sending verify code email', { email, code }) console.log('sending verify code email', { email, code })

Wyświetl plik

@ -16,11 +16,11 @@ const ky = defaultKy.extend({
}) })
for (const [i, fixtureSuite] of fixtureSuites.entries()) { for (const [i, fixtureSuite] of fixtureSuites.entries()) {
const { title, fixtures } = fixtureSuite const { title, fixtures, compareResponseBodies = false } = fixtureSuite
const describeFn = fixtureSuite.only ? describe.only : describe const describeFn = fixtureSuite.only ? describe.only : describe
describeFn(title, () => { describeFn(title, () => {
let responseBody: any | undefined let fixtureResponseBody: any | undefined
for (const [j, fixture] of fixtures.entries()) { for (const [j, fixture] of fixtures.entries()) {
const method = fixture.request?.method ?? 'GET' const method = fixture.request?.method ?? 'GET'
@ -86,11 +86,11 @@ for (const [i, fixtureSuite] of fixtureSuites.entries()) {
expect(body).toMatchSnapshot() expect(body).toMatchSnapshot()
} }
if (status >= 200 && status < 300) { if (compareResponseBodies && status >= 200 && status < 300) {
if (!responseBody) { if (!fixtureResponseBody) {
responseBody = body fixtureResponseBody = body
} else { } else {
expect(body).toEqual(responseBody) expect(body).toEqual(fixtureResponseBody)
} }
} }

Wyświetl plik

@ -38,11 +38,15 @@ export type E2ETestFixtureSuite = {
/** @default false */ /** @default false */
sequential?: boolean sequential?: boolean
/** @default false */
compareResponseBodies?: boolean
} }
export const fixtureSuites: E2ETestFixtureSuite[] = [ export const fixtureSuites: E2ETestFixtureSuite[] = [
{ {
title: 'Basic OpenAPI getPost(1)', title: 'Basic OpenAPI getPost(1)',
compareResponseBodies: true,
fixtures: [ fixtures: [
{ {
path: 'dev/test-basic-openapi/getPost', path: 'dev/test-basic-openapi/getPost',