Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions integration-tests/email.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect, beforeAll } from 'vitest';
import { signUpAndSignIn, createClient } from './setup';
import { signUpAndSignIn } from './setup';
import type { InsForgeClient } from '../src/client';

/**
Expand All @@ -15,10 +15,8 @@ import type { InsForgeClient } from '../src/client';

describe('Email Module', () => {
let authedClient: InsForgeClient;
let anonClient: InsForgeClient;

beforeAll(async () => {
anonClient = createClient();
const result = await signUpAndSignIn();
expect(result.error).toBeNull();
authedClient = result.client;
Expand Down Expand Up @@ -54,17 +52,5 @@ describe('Email Module', () => {
expect(data).toBeDefined();
}
});

it('should reject unauthenticated email send', async () => {
const { error } = await anonClient.emails.send({
to: 'test@test.insforge.dev',
subject: 'Should Fail',
html: '<p>No auth</p>',
});

// Should get 401 or similar auth error
expect(error).not.toBeNull();
expect(error!.statusCode).toBeGreaterThanOrEqual(400);
});
});
});
Loading