Skip to content

Critical Rule: Test Visual Rendering, Not Just Structure

Section titled “Critical Rule: Test Visual Rendering, Not Just Structure”

Problem: HTML structure ≠ visual rendering
Solution: Always test computed styles + browser verification

Terminal window
grep "class-name" css/*.css

Never assume framework classes exist.

window.getComputedStyle(element).display

Structure tests alone are insufficient.

Terminal window
firefox file:///path/to/file.html > /dev/null 2>&1 &

Open and verify at target breakpoints.

Test at:

  • Desktop view (full screen)
  • Mobile view (<breakpoint)
  • Breakpoint boundary (±1px)

Add to implementation:

// Real-time visibility indicator
const visible = window.getComputedStyle(elem).display !== 'none';
console.log(`Element visible: ${visible}`);
  • CSS classes verified to exist
  • Computed styles tested
  • Browser visual verification complete
  • All interactions tested

Failed: Assumed md:hidden existed (it didn’t)
Fixed: Verified CSS, used custom @media queries
Lesson: Framework assumptions cause failures

If you claim to test without browser verification = STOP