import { test } from "node:test"; import assert from "node:assert/strict"; import { parseSocialLinks } from "yt-dlp-transcript-common/lib/settingsSchema"; import { socialLinksJson } from "./socialLinksJson"; const SVG = ``; test("Keep in header on small screens: a checked row posts featured: true, an unchecked one no key", () => { const posted = JSON.parse( socialLinksJson([ { label: " A ", url: " https://a.example ", svg: ` ${SVG} `, featured: true }, { label: "B", url: "https://b.example", svg: SVG, featured: false }, { label: "C", url: "https://c.example", svg: SVG }, ]), ); assert.deepEqual(posted, [ { label: "A", url: "https://a.example", svg: SVG, featured: true }, { label: "B", url: "https://b.example", svg: SVG }, { label: "C", url: "https://c.example", svg: SVG }, ]); // …and the actions' parser keeps exactly that. assert.deepEqual(parseSocialLinks(posted), posted); });