CH-J Toolsspráva serverů přes SSH
Menu
Vydané zdroje

CH-J Tools

Procházejte adresáře a soubory konkrétního vydání aplikace.

Stáhnout zdroje ZIP
CH-J / Server Manager 406 souborů
core-20261024T135205Z-7c487d719de2 Přidáno: · Sestaveno:
navIcons.test.js Přidáno: Datum není evidováno 1,8 KB · 27 řádků
Kód Stáhnout soubor
1"use strict";
3// Navigation icons: one mapping by stable IDs for all sidebar modes and the plugin taskbar.
4const test = require("node:test");
5const assert = require("node:assert/strict");
6const fs = require("node:fs");
7const path = require("node:path");
8const icons = require("../src/renderer/vendor/lucide/icons");
9const { ICON_BY_KEY, FALLBACK, iconName } = require("../src/renderer/navIcons");
10const { PluginRegistry } = require("../src/main/plugins/pluginRegistry");
12test("every core view and bundled plugin has its own existing icon; unknown plugins fall back to puzzle", () => {
13 const html = fs.readFileSync(path.join(__dirname, "../src/renderer/index.html"), "utf8");
14 const views = [...html.matchAll(/class="nav-button[^"]*" data-view="([a-z]+)"/g)].map((match) => match[1]);
15 assert.ok(views.length >= 7);
16 const registry = new PluginRegistry(fs.mkdtempSync(path.join(require("node:os").tmpdir(), "chj-icons-")), null, { bundledRoot: path.join(__dirname, "../src/main/firstPartyPlugins") });
17 const keys = [...views, ...registry.listInstalled().map((plugin) => `plugin:${plugin.id}`)];
18 const names = keys.map((key) => iconName(key));
19 for (const [index, key] of keys.entries()) {
20 assert.notEqual(names[index], FALLBACK, `${key} has a specific icon`);
21 assert.ok(icons[names[index]]?.length, `${names[index]} exists in the vendored set`);
22 }
23 assert.equal(new Set(names).size, names.length, "no two known modules share an icon");
24 assert.equal(iconName("plugin:example.unknown"), "puzzle"); assert.ok(icons.puzzle.length);
25 for (const name of Object.values(ICON_BY_KEY)) assert.ok(icons[name], `mapped icon ${name} is vendored`);
26 assert.ok(fs.readFileSync(path.join(__dirname, "../src/renderer/vendor/lucide/LICENSE.txt"), "utf8").startsWith("ISC License"));
27});
SHA-256c26ada9bf7870bc06ba8acc661c9151fad41d60550343bac2d6bfcbc48707d7b

CH-J Proprietary Software License 1.14 · Zdroje jsou zveřejněny pod CH-J Proprietary Software License 1.14. Jejich dostupnost nemění licenční podmínky ani neposkytuje další oprávnění.

SHA-256 archivu476ed8aef0f1e96a5acdf223127b6692acdf4492eeaf5d0816b6e2a634fbbda6
Soubory