mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 18:43:38 +01:00
Make the existing fixture and privacy checks collect correctly
The original complete source-khn5eq8l failure established two inherited test defects: a node:test file miscollected by Vitest and a privacy assertion selecting an earlier link. Carry their existing 62f4d940 test-only repair independently of its still-unqualified dependency graph. Every fixture assertion body and privacy label/destination remains intact; no dependency update or product runtime is imported. Contract-Neutral: Test collection and diagnosis-section selection only; no product runtime, documentation behaviour, API, security or subsystem contract delta. Change-source: pulse-maintainer
This commit is contained in:
@@ -64,7 +64,7 @@ fixtures once, before browser execution, from `frontend-modern`:
|
||||
|
||||
```sh
|
||||
node browser-tests/build-publication-fixtures.mjs
|
||||
node --test browser-tests/publication-fixture-server.test.cjs
|
||||
npm run test -- browser-tests/publication-fixture-server.test.mjs
|
||||
```
|
||||
|
||||
The four corresponding browser runners use the resulting static bundles in
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const http = require('node:http');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
const { afterEach, test } = require('node:test');
|
||||
const {
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import http from 'node:http';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { afterEach, test } from 'vitest';
|
||||
import {
|
||||
createPublicationFixtureServer,
|
||||
loadPublicationFixture,
|
||||
runtimePaths,
|
||||
entryPaths,
|
||||
harnessPaths,
|
||||
hash,
|
||||
} = require('./publication-fixture-server.cjs');
|
||||
} from './publication-fixture-server.cjs';
|
||||
|
||||
const temporary = [];
|
||||
afterEach(() => {
|
||||
@@ -12,7 +12,7 @@ const article = (name: string): HTMLElement => {
|
||||
element.innerHTML = renderDocMarkdown(read(`docs/${name}.md`), name);
|
||||
return element;
|
||||
};
|
||||
const sectionText = (name: string, start: string, end: string): string => {
|
||||
const sectionArticle = (name: string, start: string, end: string): HTMLElement => {
|
||||
const source = read(`docs/${name}.md`).split(start)[1]?.split(end)[0];
|
||||
expect(
|
||||
source,
|
||||
@@ -20,8 +20,10 @@ const sectionText = (name: string, start: string, end: string): string => {
|
||||
).toBeDefined();
|
||||
const element = document.createElement('article');
|
||||
element.innerHTML = renderDocMarkdown(source!, name);
|
||||
return element.textContent!.replace(/\s+/g, ' ').trim();
|
||||
return element;
|
||||
};
|
||||
const sectionText = (name: string, start: string, end: string): string =>
|
||||
sectionArticle(name, start, end).textContent!.replace(/\s+/g, ' ').trim();
|
||||
const recoveryText = (): string =>
|
||||
sectionText(
|
||||
'TROUBLESHOOTING',
|
||||
@@ -76,6 +78,18 @@ describe('notification evidence privacy help', () => {
|
||||
WEBHOOKS: article('WEBHOOKS'),
|
||||
TROUBLESHOOTING: article('TROUBLESHOOTING'),
|
||||
};
|
||||
const entryPoints: Record<string, HTMLElement> = {
|
||||
WEBHOOKS: sectionArticle(
|
||||
'WEBHOOKS',
|
||||
'**Retries and retained failures.**',
|
||||
'**Correlation header.**',
|
||||
),
|
||||
TROUBLESHOOTING: sectionArticle(
|
||||
'TROUBLESHOOTING',
|
||||
'#### Recover retained delivery failures',
|
||||
'#### Emails not sending',
|
||||
),
|
||||
};
|
||||
const cases = [
|
||||
[
|
||||
'TROUBLESHOOTING',
|
||||
@@ -91,7 +105,7 @@ describe('notification evidence privacy help', () => {
|
||||
],
|
||||
];
|
||||
for (const [from, to, href, label] of cases) {
|
||||
const link = guides[from].querySelector(`a[href="${href}"]`);
|
||||
const link = entryPoints[from].querySelector(`a[href="${href}"]`);
|
||||
expect(link?.textContent).toBe(label);
|
||||
expect(guides[to].querySelector(href.slice(href.indexOf('#')))).not.toBeNull();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user