ktg-plugin-marketplace/plugins/linkedin-studio/render/__tests__/build-html.test.mjs
Kjell Tore Guttormsen b6bb61246b refactor(linkedin)!: rename plugin linkedin-thought-leadership → linkedin-studio (v3.0.0)
BREAKING CHANGE: the marketplace slug, the agent namespace
(linkedin-studio:<agent>), and the runtime state-file path
(~/.claude/linkedin-studio.local.md) all change. Reinstall required;
existing state migrated in place (post metrics, streak, history preserved).
The /linkedin:* commands are unchanged — the command namespace is set
per-command in frontmatter and was always independent of the plugin slug.
Functionality is byte-identical to v2.4.0; this release is pure identity.

- dir + manifests: plugins/linkedin-studio + plugin.json + root marketplace.json
- agent namespace updated in commands/newsletter.md (only functional invoker)
- state path updated in 4 hook scripts + topic-rotation prompt + state template
- catch-all skill dir renamed skills/linkedin-studio (5 functional skills unchanged)
- docs + version bump to 3.0.0 across README badge, CHANGELOG, root README/CLAUDE.md
- historical records (CHANGELOG past entries, docs/ build artifacts,
  config-audit v5.0.0 snapshots) intentionally retain the old slug

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 11:32:02 +02:00

65 lines
2.1 KiB
JavaScript

import { describe, test } from 'node:test';
import assert from 'node:assert/strict';
import { markdownToHtml, inline } from '../build-html.mjs';
describe('markdownToHtml — tables (beslutning H)', () => {
test('converts a pipe table to <table>/<tr>/<td>', () => {
const md = [
'| Plattform | Pris |',
'| --- | --- |',
'| Azure | Høy |',
'| Foundry | Lav |',
].join('\n');
const html = markdownToHtml(md);
assert.match(html, /<table>/);
assert.match(html, /<tr>/);
assert.match(html, /<td>/);
// header cells render as <th>, body values as <td>
assert.match(html, /<th>Plattform<\/th>/);
assert.match(html, /<td>Azure<\/td>/);
// the separator row must NOT become a data row
assert.doesNotMatch(html, /<td>---<\/td>/);
});
test('empty input produces no table', () => {
assert.doesNotMatch(markdownToHtml(''), /<table>/);
});
test('tolerates a malformed row (uneven cell count) without throwing', () => {
const md = [
'| a | b |',
'| --- | --- |',
'| only-one-cell |',
'| x | y |',
].join('\n');
let html;
assert.doesNotThrow(() => { html = markdownToHtml(md); });
assert.match(html, /<table>/);
assert.match(html, /<td>x<\/td>/);
});
});
describe('markdownToHtml — heading levels # … #### (beslutning H)', () => {
test('# renders <h1>', () => {
assert.match(markdownToHtml('# Tittel'), /<h1>Tittel<\/h1>/);
});
test('## renders <h2>', () => {
assert.match(markdownToHtml('## Seksjon'), /<h2>Seksjon<\/h2>/);
});
test('### renders <h3>', () => {
assert.match(markdownToHtml('### Under'), /<h3>Under<\/h3>/);
});
test('#### renders <h4>', () => {
assert.match(markdownToHtml('#### Detalj'), /<h4>Detalj<\/h4>/);
});
});
describe('inline — backtick code span (beslutning H)', () => {
test('`code` renders <code>', () => {
assert.match(inline('bruk `npm install` her'), /<code>npm install<\/code>/);
});
test('still handles **bold** and *italic*', () => {
assert.match(inline('**fet** og *kursiv*'), /<strong>fet<\/strong>/);
assert.match(inline('**fet** og *kursiv*'), /<em>kursiv<\/em>/);
});
});