web/website/tests/cp-redirects.test.mjs
unimatrixgit 77cdf19faa Checkpoint Alpha 1.0.0.3 graphical menus and moderation evidence
Preserve the current Alpha source and artwork snapshot. See handoff/alpha-1.0.0.3 for actual deployed hashes, checks, staged follow-ups and the production pause. This checkpoint does not claim every source feature is deployed.
2026-11-02 00:05:34 +01:00

11 lines
875 B
JavaScript

import {test} from 'node:test';
import assert from 'node:assert/strict';
import {controlPanelRedirect} from '../node/cp-redirects.mjs';
test('account and support use CP; standalone commerce stays public',()=>{
for(const [page,section]of [['account.html','game'],['portal.html','game'],['profile.html','game'],['login.html','game'],['tickets.html','tickets']]){
const response=controlPanelRedirect(new Request('https://www.dunerealms.com/'+page+'?banId=case-1'));
assert.equal(response.status,302);assert.equal(response.headers.get('Location'),'https://cp.dunerealms.com/?banId=case-1#'+section);
}
for(const path of ['forums.html','exchange.html','shop.html'])assert.equal(controlPanelRedirect(new Request('https://www.dunerealms.com/'+path)),null);
assert.equal(controlPanelRedirect(new Request('https://www.dunerealms.com/account.html',{method:'POST'})),null);
});