mirror of
https://github.com/lawrencehook/remove-youtube-suggestions.git
synced 2026-07-25 06:54:31 +00:00
8825666512
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.
44 lines
1.1 KiB
JavaScript
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');
|
|
});
|
|
});
|
|
});
|