lazycodex-ai 5.1.34 → 5.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +122 -48
- package/dist/cli-node/index.js +122 -48
- package/package.json +1 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +2 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +2 -1
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +2 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +18 -17
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/shared/package.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/index.js +4 -4
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +2 -2
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +8 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +3 -2
- package/packages/omo-codex/plugin/skills/frontend/references/perfection/README.md +2 -1
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/accent-stripes/color.ts +132 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/accent-stripes/css-parse.ts +103 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/accent-stripes/declarations.ts +156 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/accent-stripes/findings.ts +34 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/accent-stripes/gradient.ts +70 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/accent-stripes/lint.ts +110 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/accent-stripes/markup.ts +148 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/accent-stripes/selector.ts +46 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/accent-stripes/tailwind.ts +117 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/check-accent-stripes.ts +50 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/exempt-states.css +4 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/flat-stripe-side.tsx +11 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/full-surface-gradients.css +34 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/inline-ok.tsx +7 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/neutral-and-flat.css +6 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/pseudo-overlays.css +3 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/tailwind-ok.tsx +11 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/uniform-and-rings.css +3 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/wide-blocks-and-hairlines.css +3 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/apply.css +3 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/border-top-card.css +5 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/cva-variant.ts +1 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/gradient-edges.css +26 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/inline-styles.tsx +6 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/inset-shadow.css +4 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/non-visible-focus-and-nested.tsx +6 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/pseudo-bar.css +13 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/split-rule-and-token.scss +14 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/styled-components.tsx +14 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/tailwind-cards.tsx +8 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/tailwind-inset-and-style.vue +11 -0
- package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/tailwind-pseudo.html +3 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/report-gates.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-figures.mjs +22 -6
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +51 -4
- package/packages/shared-skills/skills/browser/runtime/omowright/index.js +4 -4
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +2 -2
- package/packages/shared-skills/skills/frontend/SKILL.md +8 -1
- package/packages/shared-skills/skills/frontend/references/design/README.md +3 -2
- package/packages/shared-skills/skills/frontend/references/perfection/README.md +2 -1
- package/packages/shared-skills/skills/frontend/scripts/perfection/accent-stripes/color.ts +132 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/accent-stripes/css-parse.ts +103 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/accent-stripes/declarations.ts +156 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/accent-stripes/findings.ts +34 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/accent-stripes/gradient.ts +70 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/accent-stripes/lint.ts +110 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/accent-stripes/markup.ts +148 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/accent-stripes/selector.ts +46 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/accent-stripes/tailwind.ts +117 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/check-accent-stripes.test.ts +86 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/check-accent-stripes.ts +50 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/exempt-states.css +4 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/flat-stripe-side.tsx +11 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/full-surface-gradients.css +34 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/inline-ok.tsx +7 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/neutral-and-flat.css +6 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/pseudo-overlays.css +3 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/tailwind-ok.tsx +11 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/uniform-and-rings.css +3 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/negative/wide-blocks-and-hairlines.css +3 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/apply.css +3 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/border-top-card.css +5 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/cva-variant.ts +1 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/gradient-edges.css +26 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/inline-styles.tsx +6 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/inset-shadow.css +4 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/non-visible-focus-and-nested.tsx +6 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/pseudo-bar.css +13 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/split-rule-and-token.scss +14 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/styled-components.tsx +14 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/tailwind-cards.tsx +8 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/tailwind-inset-and-style.vue +11 -0
- package/packages/shared-skills/skills/frontend/scripts/perfection/fixtures/accent-stripes/positive/tailwind-pseudo.html +3 -0
- package/packages/shared-skills/skills/ulw-research/references/report-gates.md +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/gates-figures.mjs +22 -6
- package/packages/shared-skills/skills/ulw-research/scripts/gates-static.test.ts +13 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const card = cva("rounded-xl bg-white p-6 border-l-4 border-rose-500")
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.hard-stop {
|
|
2
|
+
border-radius: 12px;
|
|
3
|
+
background: linear-gradient(to right, #6366f1 4px, #fff 4px);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.image-border {
|
|
7
|
+
border-radius: 12px;
|
|
8
|
+
border-left: 4px solid;
|
|
9
|
+
border-image: linear-gradient(#6366f1, #a855f7) 1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.glow { position: relative; border-radius: 12px; }
|
|
13
|
+
.glow::before {
|
|
14
|
+
content: "";
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
width: 3px;
|
|
20
|
+
background: linear-gradient(to bottom, #6366f1, #a855f7);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.end-band {
|
|
24
|
+
border-radius: 12px;
|
|
25
|
+
background-image: linear-gradient(to right, #fff calc(100% - 4px), #f43f5e calc(100% - 4px));
|
|
26
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const css = css`
|
|
2
|
+
.card:focus-within { border-radius: 12px; border-left: 3px solid #6366f1; }
|
|
3
|
+
td .promo-card { border-radius: 8px; border-left: 4px solid #f43f5e; }
|
|
4
|
+
`
|
|
5
|
+
|
|
6
|
+
export const Focused = () => <div className="rounded-xl focus:border-l-4 focus:border-indigo-500">Card</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.callout {
|
|
2
|
+
border-radius: 0.75rem;
|
|
3
|
+
border-left: 3px solid var(--color-accent);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tile {
|
|
7
|
+
border-radius: 16px;
|
|
8
|
+
background: var(--surface);
|
|
9
|
+
&.is-featured {
|
|
10
|
+
border-left-width: 4px;
|
|
11
|
+
border-left-style: solid;
|
|
12
|
+
border-left-color: hsl(262 83% 58%);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import styled, { createGlobalStyle } from "styled-components"
|
|
2
|
+
|
|
3
|
+
export const Banner = styled.div`
|
|
4
|
+
padding: ${({ theme }) => theme.space[4]}px;
|
|
5
|
+
border-radius: 12px;
|
|
6
|
+
border-left: 4px solid #2563eb;
|
|
7
|
+
`
|
|
8
|
+
|
|
9
|
+
export const Global = createGlobalStyle`
|
|
10
|
+
.promo-card {
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
border-top: 3px solid var(--color-brand);
|
|
13
|
+
}
|
|
14
|
+
`
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function Cards({ featured }: { featured: boolean }) {
|
|
2
|
+
return (
|
|
3
|
+
<section>
|
|
4
|
+
<div className="rounded-xl border-l-4 border-indigo-500 bg-white p-6">Fast</div>
|
|
5
|
+
<article className={cn("rounded-2xl p-4", featured && "border-t-4 border-t-primary")}>Plans</article>
|
|
6
|
+
</section>
|
|
7
|
+
)
|
|
8
|
+
}
|
|
@@ -19,7 +19,7 @@ This reference catalogs every defect code the report gates (`static`, `layout`,
|
|
|
19
19
|
| `chart_without_figure` | major | false | An image or chart lacks a figure wrapper with a caption. Uncaptioned charts isolate visuals from narrative flow. | Wrap the image or chart in a figure container with a caption. |
|
|
20
20
|
| `chart_svg_no_text` | major | false | An SVG chart or diagram lacks a title, axis labels, units, or value labels. Visuals cannot stand alone without text guidance. | Give the chart a title, axis labels, units, and value labels as SVG text. |
|
|
21
21
|
| `chart_svg_missing_labels` | minor | false | An SVG chart has some labels (e.g., title) but is missing others (e.g., axis ticks or unit). | Add the missing title, axis ticks, or unit label to the chart. |
|
|
22
|
-
| `report_without_visual` | major | false | The report body has no chart, diagram, or figure image at all (header logos, icons, and images marked decorative do not count; only rendered output counts, so a Mermaid source block or
|
|
22
|
+
| `report_without_visual` | major | false | The report body has no chart, diagram, or figure image at all (header logos, icons, and images marked decorative do not count; only rendered output counts, so a Mermaid source block or an image with any zero dimension (attribute, inline style, or viewBox) does not; an element with no declared size counts, because the browser sizes it, and the layout gate is where rendering is proven). A text-only report hides structure and trends the reader would see at a glance. | Add at least one captioned visual of the findings: a chart from the data table, a rendered Mermaid diagram, or a figure image (references/report-visualization.md). |
|
|
23
23
|
| `image_missing_alt` | minor | false | A figure image has a missing or empty `alt` and is not marked decorative. Screen readers and failed image loads leave the reader with nothing. An image is decorative only with an empty `alt` plus `role="presentation"` (or `role="none"`, or `aria-hidden="true"`): it raises nothing here and does not count as a visual. | Give the image an alt attribute that states what it shows, not its file name; mark a purely decorative image alt="" with role="presentation". |
|
|
24
24
|
| `korean_serif_font` | major | false | A serif or brush Korean font family is applied to Korean text. The design spec mandates gothic (sans) Korean typefaces. | Use a gothic (sans) Korean family; serif and brush families are banned by the design spec. |
|
|
25
25
|
| `section_without_citation` | major | false | A major section or subsection contains no in-text citations or reference marks. Source attribution is missing. | Cite at least one source inside this section or merge it into a cited one. |
|
|
@@ -27,14 +27,30 @@ function pixels(value) {
|
|
|
27
27
|
return match ? Number(match[1]) : null
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function fromStyle(node, prop) {
|
|
31
|
+
return pixels(new RegExp(`(?:^|;)\\s*${prop}\\s*:\\s*([^;]+)`, "i").exec(node.attrs.style ?? "")?.[1])
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function viewBoxSize(node) {
|
|
35
|
+
const box = String(node.attrs.viewbox ?? "").trim().split(/[\s,]+/).map(Number)
|
|
36
|
+
return box.length === 4 && box.every(Number.isFinite) ? { width: box[2], height: box[3] } : null
|
|
37
|
+
}
|
|
38
|
+
|
|
30
39
|
/** Largest declared dimension: width/height attributes or style, else the viewBox. */
|
|
31
40
|
function declaredSize(node) {
|
|
32
|
-
const
|
|
33
|
-
const fromStyle = (prop) => pixels(new RegExp(`(?:^|;)\\s*${prop}\\s*:\\s*([^;]+)`, "i").exec(style)?.[1])
|
|
34
|
-
const sizes = [pixels(node.attrs.width), pixels(node.attrs.height), fromStyle("width"), fromStyle("height")].filter((n) => n !== null)
|
|
41
|
+
const sizes = [pixels(node.attrs.width), pixels(node.attrs.height), fromStyle(node, "width"), fromStyle(node, "height")].filter((n) => n !== null)
|
|
35
42
|
if (sizes.length) return Math.max(...sizes)
|
|
36
|
-
const box =
|
|
37
|
-
return box
|
|
43
|
+
const box = viewBoxSize(node)
|
|
44
|
+
return box ? Math.max(box.width, box.height) : null
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* True when any declared dimension is zero, so the element cannot render visibly. Each axis reads its inline
|
|
49
|
+
* style first, then its attribute, then the viewBox. An undeclared axis is not zero: the browser sizes it.
|
|
50
|
+
*/
|
|
51
|
+
function hasZeroDimension(node) {
|
|
52
|
+
const box = viewBoxSize(node)
|
|
53
|
+
return ["width", "height"].some((axis) => (fromStyle(node, axis) ?? pixels(node.attrs[axis]) ?? box?.[axis] ?? null) === 0)
|
|
38
54
|
}
|
|
39
55
|
|
|
40
56
|
function isIcon(ctx, node) {
|
|
@@ -174,7 +190,7 @@ export const figureGates = [
|
|
|
174
190
|
{
|
|
175
191
|
codes: ["report_without_visual"],
|
|
176
192
|
run(ctx) {
|
|
177
|
-
if (visuals(ctx).some((node) =>
|
|
193
|
+
if (visuals(ctx).some((node) => !hasZeroDimension(node) && !isDecorative(node))) return []
|
|
178
194
|
return [ctx.defect("report_without_visual", ctx.body, "the report has no chart, diagram, or figure image")]
|
|
179
195
|
},
|
|
180
196
|
},
|
|
@@ -263,6 +263,19 @@ describe("report-level visuals", () => {
|
|
|
263
263
|
expect(chartCodes(htmlLabels)).toEqual(["chart_svg_no_text"])
|
|
264
264
|
})
|
|
265
265
|
|
|
266
|
+
test("#given a single visual with one zero dimension #when checked #then report_without_visual is raised; viewBox-only and unsized visuals still count", () => {
|
|
267
|
+
// given
|
|
268
|
+
const only = (el: string) => `<figure>${el}<figcaption>c</figcaption></figure>`
|
|
269
|
+
const flat = only('<img src="data:image/png;base64,iVBORw0KGgo=" alt="chart" width="600" height="0">')
|
|
270
|
+
const narrow = only('<svg width="0" height="300"><text>A</text></svg>')
|
|
271
|
+
const styled = only('<img src="data:image/png;base64,iVBORw0KGgo=" alt="chart" width="600" height="300" style="height: 0">')
|
|
272
|
+
const viewBoxOnly = only('<svg viewBox="0 0 600 300" aria-roledescription="flowchart-v2"><text>A</text></svg>')
|
|
273
|
+
const unsized = only('<img src="data:image/png;base64,iVBORw0KGgo=" alt="Deploys per week">')
|
|
274
|
+
// when / then
|
|
275
|
+
for (const html of [flat, narrow, styled]) expect(has(html, "report_without_visual")).toBe(true)
|
|
276
|
+
for (const html of [viewBoxOnly, unsized]) expect(has(html, "report_without_visual")).toBe(false)
|
|
277
|
+
})
|
|
278
|
+
|
|
266
279
|
test("#given figure images with no alt, a bare empty alt, role- and aria-marked decorative alts and a descriptive alt #when checked #then only the unmarked two raise image_missing_alt", () => {
|
|
267
280
|
// given
|
|
268
281
|
const img = (alt: string) => `<figure><img src="data:image/png;base64,iVBORw0KGgo=" ${alt} width="480" height="240"><figcaption>c</figcaption></figure>`
|