feat(topics): restore topic taxonomy workflow
This commit is contained in:
1 parent
f3dd1ec3b1
commit
a254cbd3e9
59 files changed
+771
-192
No files matched your search
@@ -0,0 +1,22 @@
|
||||
const assert = require('node:assert/strict');
|
||||
const { execFileSync } = require('node:child_process');
|
||||
const path = require('node:path');
|
||||
const test = require('node:test');
|
||||
|
||||
const result = JSON.parse(execFileSync('php', [path.join(__dirname, 'topics-harness.php')], { encoding: 'utf8' }));
|
||||
|
||||
test('topic whitelist includes descendants and preserves a selected child without its parent', () => {
|
||||
assert.deepEqual(result.root_tree, [
|
||||
{ id: 1, depth: 0 },
|
||||
{ id: 2, depth: 1 },
|
||||
{ id: 3, depth: 1 },
|
||||
]);
|
||||
assert.deepEqual(result.child_tree, [{ id: 2, depth: 0 }]);
|
||||
assert.match(result.orphan_html, /name="topics\[\]" value="2"/);
|
||||
});
|
||||
|
||||
test('topic submissions accept only existing terms within the configured whitelist', () => {
|
||||
assert.deepEqual(result.filtered, [2]);
|
||||
assert.deepEqual(result.disabled_tree, []);
|
||||
assert.deepEqual(result.disabled_filtered, []);
|
||||
});
|
||||
Reference in new issue
Block a user