Skip to content

test(view): regression spec for inline-SVG icon convention in migrator view#2565

Merged
bpamiri merged 1 commit into
developfrom
claude/tender-goldberg-957cc7
May 11, 2026
Merged

test(view): regression spec for inline-SVG icon convention in migrator view#2565
bpamiri merged 1 commit into
developfrom
claude/tender-goldberg-957cc7

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented May 11, 2026

Summary

Adds a regression test (vendor/wheels/tests/specs/migrator/MigratorViewIconsSpec.cfc) that locks in the inline-SVG icon convention for the migrator dashboard.

The original bug (broken icon glyph on the Database Error placeholder, #2427 / #2425) has already been fixed on develop via two earlier PRs:

  • #2562 replaced the offending Semantic UI icon-font tag on line 299 of vendor/wheels/public/views/migrator.cfm with an inline SVG that matches the sibling "No migration files found" placeholder.
  • #2563 inlined the Semantic UI icon font globally (base64 data URI in _header.cfm / _header_simple.cfm), so font-based glyphs now render across every framework dev page (/wheels/guides, /wheels/info, /wheels/migrator, etc.).

This PR was originally opened against the unfixed state and conflicted with develop after #2562 / #2563 landed. Rebased to drop the duplicate view change + duplicate CHANGELOG entry and keep just the new regression spec — convention enforcement for migrator.cfm going forward.

Related Issue

Closes #2427 (duplicate of #2425; substantive fix is on develop).

Type of Change

  • Bug fix
  • New feature
  • Enhancement to existing feature
  • Documentation update
  • Refactoring
  • Test-only (regression coverage)

What this test asserts

  1. The Database Error placeholder in vendor/wheels/public/views/migrator.cfm uses an inline <svg> (not an icon-font tag).
  2. The whole file contains zero <i ...icon...> opener tags.

Both checks build their regex literals via Chr(60) & ... to avoid the Lucee tag-scanner trap documented in .ai/wheels/testing/.

Feature Completeness Checklist

  • Tests — The new spec at vendor/wheels/tests/specs/migrator/MigratorViewIconsSpec.cfc is the entire change.
  • Framework Docs — n/a (test-only, no public API change)
  • AI Reference Docs — n/a
  • CLAUDE.md — n/a
  • CHANGELOG.md — n/a (the user-facing fix already has an entry from fix(view): inline Semantic UI icon font so dev page icons render #2563; this PR only adds a test)
  • Test runner passes — Verified with an equivalent Python regex run against the current vendor/wheels/public/views/migrator.cfm on develop: both checks pass (anchor found at byte ~16700, <svg present in the 1500-char window before it, zero icon-font hits in the 50KB file). CI will run the CFML spec end-to-end.

Test Plan

# Local
bash tools/test-local.sh migrator

# CI
# Runs as part of every PR via pr.yml and snapshot.yml across the matrix.

The test reads migrator.cfm directly via FileRead(ExpandPath("/wheels/public/views/migrator.cfm")) — no database, no HTTP, no fixtures required. It will pass on every engine × DB combo so long as migrator.cfm keeps its inline-SVG convention.

🤖 Generated with Claude Code

…r view

Adds vendor/wheels/tests/specs/migrator/MigratorViewIconsSpec.cfc that
asserts (1) the migrator view's Database Error placeholder uses an
inline SVG icon, and (2) the file contains no Semantic UI icon-font
tags. Documents the inline-SVG convention used throughout
vendor/wheels/public/views/migrator.cfm and guards against drift.

The original bug (broken icon glyph on Database Error placeholder,
#2427) was fixed by:
- #2562 - replaced the offending icon-font tag with an inline SVG
  matching the sibling "No migration files found" placeholder.
- #2563 - inlined the Semantic UI icon font globally so font-based
  glyphs render across all framework dev pages.

This test is convention enforcement - it catches reintroduction of
icon-font tags in this file even though the font now loads.

Closes #2427.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bpamiri bpamiri force-pushed the claude/tender-goldberg-957cc7 branch from d8e1ba0 to 1301ea6 Compare May 11, 2026 13:55
@bpamiri bpamiri changed the title fix(view): replace broken icon-font glyph in migrator database-error placeholder test(view): regression spec for inline-SVG icon convention in migrator view May 11, 2026
@bpamiri bpamiri marked this pull request as ready for review May 11, 2026 14:00
Copy link
Copy Markdown
Contributor

@wheels-bot wheels-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wheels Bot — Reviewer A

TL;DR: This PR adds a single regression spec (vendor/wheels/tests/specs/migrator/MigratorViewIconsSpec.cfc) that enforces the inline-SVG icon convention in the migrator dashboard view. The change is test-only, correct, cross-engine safe, and follows BDD conventions. Approving with two minor nits.


Correctness

The test logic holds up under scrutiny:

  • Find("Database Error", source) correctly returns the byte position of the anchor text (line 300 of migrator.cfm). The expect(anchor).toBeGT(0, ...) guard catches a missing anchor with a helpful message.
  • The window arithmetic (windowStart = Max(anchor - 1500, 1), windowLen = anchor - windowStart) captures exactly 1500 characters immediately before the anchor — sufficient to contain the preceding <svg> block, which is confirmed to be ~380 chars in the current file. The comment explaining the 700-char estimate refers to path data length; 1500 is a safe upper bound.
  • reFindNoCase returns 0 when no match is found. expect(fontIconHit).toBe(0) is the correct idiom for that return value.
  • reMatchNoCase returns an array of all matches; expect(ArrayLen(hits)).toBe(0) is correct for "no matches".
  • toBeGT, toInclude, and toBe all accept a message second argument as defined in vendor/wheels/wheelstest/system/Expectation.cfc lines 624, 560, and 168 respectively — usage is valid.

Conventions

The Chr(60) & "i[\s>][^>]*\bicon\b" pattern correctly avoids embedding a literal < in a CFML string expression, following the guidance in .ai/wheels/testing/ and consistent with the # scanner trap documented in CLAUDE.md. The spec extends wheels.WheelsTest (not the legacy wheels.Test) and uses BDD describe/it/expect syntax throughout — correct.

Nit — duplicate FileRead call (lines 23 and 59):

// it block 1 (line 23)
var source = FileRead(ExpandPath("/wheels/public/views/migrator.cfm"));

// it block 2 (line 59)
var source = FileRead(ExpandPath("/wheels/public/views/migrator.cfm"));

Both it blocks read the same file independently. A beforeAll (or a describe-level local.source read once at the top of run()) would eliminate the duplicate disk hit. This is cosmetic — the file is ~50 KB and reads in milliseconds — but worth a one-line fix.

Cross-engine

All functions used (FileRead, ExpandPath, Find, Mid, Max, reFindNoCase, reMatchNoCase, Chr, ArrayLen, ArrayToList) are standard CFML and work on Lucee 6/7, Adobe CF 2023/2025, and BoxLang. Arrow-function closures (() => {}) are supported by every engine in the CI matrix. No struct.map() on CFC objects, no application scope members, no client scope usage. The Left(str, 0) Lucee 7 gotcha (CLAUDE.md "Known cross-engine gotchas") does not apply here — Mid() is used, and the degenerate windowLen = 0 case (which would require "Database Error" to appear at byte position 1 in the file) cannot occur in practice.

Tests

This PR is entirely test code and is self-verifying. Both happy-path assertions (<svg present, zero icon-font tags) pass against the current migrator.cfm on develop as confirmed by the PR description's Python pre-check. ExpandPath("/wheels/public/views/migrator.cfm") follows the same /wheels/ virtual-path convention used in migratorSpec.cfc line 386 — path resolution is correct.

Docs

Nit — PR labels: The PR carries docs and enhancement labels, but the type-of-change checklist correctly marks [x] Test-only (regression coverage). The labels do not reflect the test-only nature and may mislead triage — worth updating.

Commits

Single commit: test(view): regression spec for inline-SVG icon convention in migrator view

  • Type test: valid
  • Scope view: valid (the spec tests migrator.cfm, a view template)
  • Subject 60 chars, not ALL-CAPS: valid
  • Describes the why ("regression spec for ... convention"), not just the what: valid

No commitlint violations.

Security

No user input, no SQL, no XSS surface. FileRead reads a known framework-owned path resolved via ExpandPath — no path traversal risk.


@bpamiri bpamiri merged commit aff3adb into develop May 11, 2026
7 checks passed
@bpamiri bpamiri deleted the claude/tender-goldberg-957cc7 branch May 11, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken icon displayed on migration templating page during database errors

1 participant