Files
Lawrence Hook 8825666512 Merge the monetization feature branch.
Add RYS Premium subscription system

Introduce optional paid tier with sign-in, Stripe billing, and premium
feature gating. Core features remain free. Includes Node.js server for
auth, payments, and license management.

Extension changes:
- Sign-in flow with magic link email
- Premium/upgrade/account modals with branded UI
- Premium feature gating (60+ advanced settings)
- Password lock and scheduling (premium)
- Fix "hide all but first row" for YouTube's new flat homepage DOM
- Hide sidebar ad panels by default
- Enable "Hide all Shorts" by default

Server:
- Magic link auth with rate limiting
- Stripe checkout, webhooks, and billing portal
- JWT-based license tokens
- AWS SES transactional emails (welcome, sign-in, cancellation)
- Grandfathered donor support

Also adds CI workflow, server test suite, and extension unit tests.
2026-02-15 18:45:37 -05:00

44 lines
1.1 KiB
JavaScript

const { describe, it, beforeEach, after } = require('node:test');
const assert = require('node:assert');
const request = require('supertest');
// Setup must be required first
const { cleanTestData } = require('./setup');
// Mock email service
const emailService = require('../src/services/email');
emailService.sendMagicLinkEmail = async () => ({ MessageId: 'test' });
const { app } = require('../src/index');
const storage = require('../src/storage');
describe('Health Check', () => {
beforeEach(() => {
cleanTestData();
storage.ensureDirectories();
});
after(() => {
cleanTestData();
});
describe('GET /health', () => {
it('should return health status', async () => {
const res = await request(app).get('/health');
assert.strictEqual(res.status, 200);
assert.strictEqual(res.body.status, 'ok');
assert.ok(res.body.timestamp);
});
});
describe('404 handling', () => {
it('should return 404 for unknown routes', async () => {
const res = await request(app).get('/unknown-route');
assert.strictEqual(res.status, 404);
assert.strictEqual(res.body.error, 'Not found');
});
});
});