sokko-g/tests/toolbox-modules.test.mjs
Shinuwa 895fec2b40
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s
structure refacto & file documentation
2026-07-25 17:51:53 +02:00

17 lines
724 B
JavaScript

// Rôle : teste les parseurs d'import texte utilisés par les outils toolbox.
import { test } from "node:test";
import assert from "node:assert/strict";
import { parseColonImportLines } from "../website/src/features/toolboxes/modules/textImport.js";
test("colon text import keeps urls intact after the first separator", () => {
assert.deepEqual(parseColonImportLines("Build:https://example.com/build?class=rogue\nPotion:10"), [
{ label: "Build", value: "https://example.com/build?class=rogue" },
{ label: "Potion", value: "10" }
]);
});
test("colon text import accepts labels without value", () => {
assert.deepEqual(parseColonImportLines("Simple item"), [
{ label: "Simple item", value: "" }
]);
});