Sweep active code, tests, identity files, public docs, CMS seed content, and stale handoffs so old assistant-name fixtures no longer leak into current Clawdie/system-namespace behavior. Keep the skills-memory SQL artifact unchanged per regeneration policy. --- Build: pass Tests: pass — 2197 passed (164 files) --- Build: pass | Tests: pass — 2197 passed (650 files)
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
import { describe, expect, it, vi } from 'vitest';
|
|
|
|
import { makePlatformRegistryFixture } from '../src/test-fixtures/platform-registry.js';
|
|
import * as surfaceInventoryModule from '../src/surface-inventory.js';
|
|
import { nginxConf } from './cms.js';
|
|
|
|
describe('setup/cms nginxConf', () => {
|
|
it('builds explicit server blocks for cms admin and tenant surfaces', () => {
|
|
vi.spyOn(surfaceInventoryModule, 'buildSurfaceInventory').mockReturnValue(
|
|
surfaceInventoryModule.buildSurfaceInventory(
|
|
makePlatformRegistryFixture(),
|
|
),
|
|
);
|
|
|
|
const conf = nginxConf({ adminUiEnabled: true });
|
|
|
|
expect(conf).toContain('listen 80 default_server;');
|
|
expect(conf).toContain('server_name cms.home.arpa cms.clawdie.si;');
|
|
expect(conf).toContain('blog.alpha.home.arpa');
|
|
expect(conf).toContain('alpha.home.arpa');
|
|
expect(conf).toContain('location /api/');
|
|
expect(conf).toContain('location /admin/');
|
|
expect(conf).toContain('location /screenshots/ {');
|
|
expect(conf).not.toContain('auth_basic_user_file');
|
|
});
|
|
|
|
it('returns 404 for admin/api paths when admin ui is disabled', () => {
|
|
const conf = nginxConf({ adminUiEnabled: false });
|
|
|
|
expect(conf).toContain('location /admin/ {');
|
|
expect(conf).toContain('location /api/ {');
|
|
expect(conf).toContain('return 404;');
|
|
expect(conf).not.toContain(
|
|
'proxy_pass http://127.0.0.1:1337/admin/;',
|
|
);
|
|
});
|
|
});
|