GitHub(nextgroup2706/ken_nogi)は今後使わず自社Gitea運用に切替え。 NodeSrvは旧リポジトリの履歴を破棄しファイルのみ統合(Dokploy用サービスアカウントは 別途mygit-admin/NodeSrv.gitに履歴あり)。notepmエクスポート(12GB)とPleasanter インストーラzip(208MB)はサイズが大きいため.gitignoreで除外。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
30 lines
1.2 KiB
JavaScript
30 lines
1.2 KiB
JavaScript
const { test } = require('node:test');
|
|
const assert = require('node:assert');
|
|
const { renderLoginPage, renderAdminPage } = require('../src/adminView');
|
|
|
|
test('renderLoginPage without error omits the error message', () => {
|
|
const html = renderLoginPage();
|
|
assert.ok(!html.includes('class="error"'));
|
|
assert.ok(html.includes('action="/admin/login"'));
|
|
});
|
|
|
|
test('renderLoginPage with error escapes and shows the message', () => {
|
|
const html = renderLoginPage('<script>bad</script>');
|
|
assert.ok(!html.includes('<script>bad</script>'));
|
|
assert.ok(html.includes('<script>'));
|
|
});
|
|
|
|
test('renderAdminPage lists emails with a remove form for each, escaping HTML', () => {
|
|
const html = renderAdminPage(['a@example.com', '<script>x</script>@example.com']);
|
|
assert.ok(html.includes('a@example.com'));
|
|
assert.ok(html.includes('value="a@example.com"'));
|
|
assert.ok(!html.includes('<script>x</script>@example.com'));
|
|
assert.ok(html.includes('action="/admin/allowlist/remove"'));
|
|
assert.ok(html.includes('action="/admin/allowlist/add"'));
|
|
});
|
|
|
|
test('renderAdminPage shows an error message when provided', () => {
|
|
const html = renderAdminPage(['a@example.com'], 'invalid email format');
|
|
assert.ok(html.includes('invalid email format'));
|
|
});
|