release: WRNexusJS 0.6.0
This commit is contained in:
@@ -37,8 +37,7 @@ const manifest = JSON.parse(readFileSync(join(root, "showcase-manifest.json"), "
|
||||
}>;
|
||||
};
|
||||
|
||||
const detailSource = (slug: string) =>
|
||||
readFileSync(join(detailPagesDir, `${slug}.wrn`), "utf8");
|
||||
const detailSource = (slug: string) => readFileSync(join(detailPagesDir, `${slug}.wrn`), "utf8");
|
||||
|
||||
const interactiveOverlayNames = [
|
||||
"ContextMenu",
|
||||
@@ -73,7 +72,9 @@ test("showcase manifest matches the generated UI reference", () => {
|
||||
expect(manifest.componentCount).toBe(reference.count);
|
||||
expect(manifest.components).toHaveLength(reference.count);
|
||||
expect(manifest.totalDemoCount).toBeGreaterThanOrEqual(reference.count * 3);
|
||||
expect(new Set(manifest.components.map((component) => component.slug)).size).toBe(reference.count);
|
||||
expect(new Set(manifest.components.map((component) => component.slug)).size).toBe(
|
||||
reference.count,
|
||||
);
|
||||
|
||||
for (const component of reference.components) {
|
||||
const documented = manifest.components.find((entry) => entry.name === component.name);
|
||||
@@ -266,7 +267,9 @@ test("overlay previews start closed and expose usable click, hover, or context t
|
||||
|
||||
expect(generator).toContain("interactiveOverlayComponents");
|
||||
expect(generator).toContain("overlayVisibilityProps.has(name)");
|
||||
expect(generator).toContain('data-interactive-preview="${isInteractiveOverlay(component) ? "true" : "false"}"');
|
||||
expect(generator).toContain(
|
||||
'data-interactive-preview="${isInteractiveOverlay(component) ? "true" : "false"}"',
|
||||
);
|
||||
expect(styles).toContain('.catalog-card[data-interactive-preview="true"]');
|
||||
expect(styles).toContain('[data-ui-component="Drawer"]');
|
||||
expect(styles).toContain('[data-ui-component="Modal"]');
|
||||
@@ -305,8 +308,18 @@ test("advanced select demos use validation schemas and a real remote API", () =>
|
||||
test("specialized form component examples remain complete", () => {
|
||||
const checks: Array<[string, string[]]> = [
|
||||
["PinInput", ["Different lengths", 'length="3"', 'length="5"', 'length="7"']],
|
||||
["TogglePassword", ["Checkbox-controlled toggle", "Synchronized password fields", 'data-schema="toggle-password-validation"']],
|
||||
["StrongPassword", ["Live strength meter", "Requirements in a popover", 'specialCharactersSet="@#_-."']],
|
||||
[
|
||||
"TogglePassword",
|
||||
[
|
||||
"Checkbox-controlled toggle",
|
||||
"Synchronized password fields",
|
||||
'data-schema="toggle-password-validation"',
|
||||
],
|
||||
],
|
||||
[
|
||||
"StrongPassword",
|
||||
["Live strength meter", "Requirements in a popover", 'specialCharactersSet="@#_-."'],
|
||||
],
|
||||
];
|
||||
for (const [name, needles] of checks) {
|
||||
const component = manifest.components.find((entry) => entry.name === name);
|
||||
@@ -328,7 +341,7 @@ test("complex component props are complete readable multiline values", () => {
|
||||
test("generated playground boolean states avoid multiline-sensitive ternaries", () => {
|
||||
const generator = readFileSync(join(root, "scripts", "generate-showcase.mjs"), "utf8");
|
||||
expect(generator).toContain('?? "${initial}") === "true"');
|
||||
expect(generator).not.toContain('=== null ? ${initial} :');
|
||||
expect(generator).not.toContain("=== null ? ${initial} :");
|
||||
|
||||
for (const component of manifest.components) {
|
||||
const source = detailSource(component.slug);
|
||||
|
||||
Reference in New Issue
Block a user