fix(review): slug-scoped tags, decode names, drop fig picker & AI labels
- Taxonomy sync keeps fig-/feat- by slug (hyphen), not name; HTML-unescape names - Review: remove AI assist labels; Features picker for feat-*; derive fig_tag_ids from Figure term names (casefold match, no bridges); decodeName on display - Unit tests for scoped_tags, fig match, Review UI contract; docs slug wording
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { test } from 'node:test';
|
||||
|
||||
const dir = dirname(fileURLToPath(import.meta.url));
|
||||
const reviewSrc = readFileSync(join(dir, 'Review.svelte'), 'utf8');
|
||||
const figSrc = readFileSync(join(dir, 'figTags.ts'), 'utf8');
|
||||
|
||||
test('Review UI: no AI assist labels or AI badge chrome', () => {
|
||||
assert.equal(reviewSrc.includes('AI assist'), false);
|
||||
assert.equal(reviewSrc.includes('class="ai"'), false);
|
||||
assert.equal(reviewSrc.includes('ps-tag'), false);
|
||||
});
|
||||
|
||||
test('Review UI: no fig-* MultiSelect picker', () => {
|
||||
assert.equal(reviewSrc.includes('data-testid="fig-tag"'), false);
|
||||
assert.equal(reviewSrc.includes('figTagOpts'), false);
|
||||
assert.equal(reviewSrc.includes('label="fig-* tags"'), false);
|
||||
assert.equal(reviewSrc.includes('placeholder="Choose fig-* tags"'), false);
|
||||
assert.match(reviewSrc, /deriveFigTagIds/);
|
||||
assert.match(reviewSrc, /Features/);
|
||||
assert.match(reviewSrc, /testid="feat-tag"/);
|
||||
});
|
||||
|
||||
test('Tag family scope uses hyphenated slug prefix', () => {
|
||||
assert.match(figSrc, /startsWith\('fig-'\)/);
|
||||
assert.match(figSrc, /startsWith\('feat-'\)/);
|
||||
assert.equal(/startsWith\('fig'\)/.test(figSrc), false);
|
||||
assert.equal(/startsWith\('feat'\)/.test(figSrc), false);
|
||||
assert.equal(/startsWith\('fig'\)/.test(reviewSrc), false);
|
||||
assert.equal(/startsWith\('feat'\)/.test(reviewSrc), false);
|
||||
});
|
||||
Reference in New Issue
Block a user