mirror of
https://github.com/blackboxprogramming/alexa-amundson-resume.git
synced 2026-03-18 05:34:08 -05:00
feat: add real Stripe integration, e2e tests, and Pi deployment
Replace documentation-only repo with working code: - Stripe integration: webhook handler (8 event types), billing API (customers, checkout, payments, subscriptions, invoices) - Express API server with health endpoint, structured logging - E2E tests (Playwright): health, webhook signature verification, billing API validation - Unit tests: webhook event handler coverage for all event types - Pi deployment: deploy.sh (rsync + systemd), NGINX load balancer across Pi cluster, Docker support - CI/CD: test workflow, Pi deploy workflow, updated auto-deploy and self-healing to run real tests before deploying - Move resume docs to docs/ to separate code from documentation https://claude.ai/code/session_01Mf5Pg82fV6BTRS9GnpV7nr
This commit is contained in:
38
tests/e2e/billing-api.spec.js
Normal file
38
tests/e2e/billing-api.spec.js
Normal file
@@ -0,0 +1,38 @@
|
||||
const { test, expect } = require('@playwright/test');
|
||||
|
||||
const BASE_URL = process.env.BASE_URL || 'http://localhost:3000';
|
||||
|
||||
test.describe('Billing API E2E', () => {
|
||||
test('POST /api/customers rejects missing email', async ({ request }) => {
|
||||
const res = await request.post(`${BASE_URL}/api/customers`, {
|
||||
data: { name: 'Test User' },
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
expect(res.status()).toBe(400);
|
||||
|
||||
const body = await res.json();
|
||||
expect(body.error).toBe('email is required');
|
||||
});
|
||||
|
||||
test('POST /api/checkout rejects missing fields', async ({ request }) => {
|
||||
const res = await request.post(`${BASE_URL}/api/checkout`, {
|
||||
data: {},
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
expect(res.status()).toBe(400);
|
||||
|
||||
const body = await res.json();
|
||||
expect(body.error).toContain('required');
|
||||
});
|
||||
|
||||
test('POST /api/payments rejects missing fields', async ({ request }) => {
|
||||
const res = await request.post(`${BASE_URL}/api/payments`, {
|
||||
data: { customerId: 'cust_123' },
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
expect(res.status()).toBe(400);
|
||||
|
||||
const body = await res.json();
|
||||
expect(body.error).toContain('required');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user