module RatatuiRuby::TestHelper::StyleAssertions

Assertions for verifying cell-level styling in terminal UIs.

TUI styling is invisible to plain text comparisons. Colors, bold, italic, and other modifiers define the visual hierarchy. Without style assertions, you cannot verify that your highlight is actually highlighted.

This mixin provides assertions to check foreground, background, and modifiers at specific coordinates or across entire regions.

Use it to verify selection highlights, error colors, or themed areas.

Examples

# Single cell
assert_cell_style(0, 0, fg: :red, modifiers: [:bold])

# Foreground color at coordinate
assert_color(:green, x: 5, y: 2)

# Entire header region
assert_area_style({ x: 0, y: 0, w: 80, h: 1 }, bg: :blue)