Plan fix: mirror sign-up URL test coverage additions for Task 3
This commit is contained in:
@@ -379,7 +379,7 @@ export default defineConfig({
|
|||||||
- [ ] **Step 2: Write the failing test `src/config/auth.test.ts`**
|
- [ ] **Step 2: Write the failing test `src/config/auth.test.ts`**
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { describe, it, expect, beforeEach } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { resolveAuthConfig } from './auth';
|
import { resolveAuthConfig } from './auth';
|
||||||
|
|
||||||
describe('resolveAuthConfig', () => {
|
describe('resolveAuthConfig', () => {
|
||||||
@@ -417,6 +417,21 @@ describe('resolveAuthConfig', () => {
|
|||||||
})).toThrow(/PUBLIC_SALES_EMAIL/);
|
})).toThrow(/PUBLIC_SALES_EMAIL/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('throws if PUBLIC_AUTH_SIGNUP_URL is missing', () => {
|
||||||
|
expect(() => resolveAuthConfig({
|
||||||
|
PUBLIC_AUTH_SIGNIN_URL: 'https://auth.cameleer.io/sign-in',
|
||||||
|
PUBLIC_SALES_EMAIL: 'sales@cameleer.io',
|
||||||
|
})).toThrow(/PUBLIC_AUTH_SIGNUP_URL/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('throws if PUBLIC_AUTH_SIGNUP_URL is not https', () => {
|
||||||
|
expect(() => resolveAuthConfig({
|
||||||
|
PUBLIC_AUTH_SIGNIN_URL: 'https://auth.cameleer.io/sign-in',
|
||||||
|
PUBLIC_AUTH_SIGNUP_URL: 'http://auth.cameleer.io/sign-in?first_screen=register',
|
||||||
|
PUBLIC_SALES_EMAIL: 'sales@cameleer.io',
|
||||||
|
})).toThrow(/must be https/);
|
||||||
|
});
|
||||||
|
|
||||||
it('exposes signUpUrl distinct from signInUrl', () => {
|
it('exposes signUpUrl distinct from signInUrl', () => {
|
||||||
const cfg = resolveAuthConfig({
|
const cfg = resolveAuthConfig({
|
||||||
PUBLIC_AUTH_SIGNIN_URL: 'https://auth.cameleer.io/sign-in',
|
PUBLIC_AUTH_SIGNIN_URL: 'https://auth.cameleer.io/sign-in',
|
||||||
|
|||||||
Reference in New Issue
Block a user