Fix tag management view entering search flow

This commit is contained in:
kuekhaoyang
2026-07-09 16:59:39 +08:00
parent 5a76958816
commit 2bb70ca648
9 changed files with 84 additions and 28 deletions
+29
View File
@@ -0,0 +1,29 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
const projectRoot = process.cwd();
test('popular tag management mode stays out of quick search and discovery grids', () => {
const source = readFileSync(
join(projectRoot, 'components/home/PopularFeatures.tsx'),
'utf8',
);
assert.match(source, /const isTagManagementMode = showTagManager;/);
assert.match(source, /!\s*isTagManagementMode && <CategoryQuickSearch/);
assert.match(source, /!\s*isTagManagementMode && !effectiveRecommendSelected/);
assert.match(source, /!\s*isTagManagementMode && \(/);
});
test('tag management list uses wrapping chip layout instead of a horizontal search filter row', () => {
const source = readFileSync(
join(projectRoot, 'components/home/TagList.tsx'),
'utf8',
);
assert.match(source, /rectSortingStrategy/);
assert.match(source, /showTagManager\s*\?\s*'flex-wrap overflow-visible'/);
assert.match(source, /showTagManager \? rectSortingStrategy : horizontalListSortingStrategy/);
});