fix(plugins): 插件中心 - 修复协议分类筛选重复展示

Refs #428
This commit is contained in:
ddCat
2026-09-07 22:35:45 +08:00
parent bdfccf51d1
commit 8a70ab27c4
3 changed files with 19 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
import { readFileSync } from "node:fs";
import { describe, expect, test } from "bun:test";
const source = readFileSync(new URL("../src/pages/plugins/index.tsx", import.meta.url), "utf8");
describe("plugin category sections (#428)", () => {
test("limits rendered sections to the selected category, not just matching plugins", () => {
const sections = source.slice(source.indexOf("const pluginSections ="), source.indexOf("const selectCategory ="));
expect(sections).toContain('categoryFilter === "all" || section.key === categoryFilter');
expect(sections).toContain("[categoryFilter, filteredPlugins]");
});
});