Skip to content

test(table): assert wrapper div has 'relative' class (RUI-5)#348

Closed
djalmaaraujo wants to merge 1 commit intomainfrom
djalma/rui-5-table-relative
Closed

test(table): assert wrapper div has 'relative' class (RUI-5)#348
djalmaaraujo wants to merge 1 commit intomainfrom
djalma/rui-5-table-relative

Conversation

@djalmaaraujo
Copy link
Contributor

@djalmaaraujo djalmaaraujo commented Feb 26, 2026

Problem

The Table component wraps the <table> element in a div. Without the relative CSS class on that wrapper, absolutely-positioned children (sticky headers, tooltips, overlays) would be positioned relative to the nearest ancestor instead of the table container, causing layout bugs.

Fix

The fix (relative w-full overflow-auto on the wrapper div) was already present in the codebase (lib/ruby_ui/table/table.rb). However, there was no test asserting this class is rendered, leaving the implementation without regression coverage.

Changes

  • test/ruby_ui/table_test.rb: Added test_render_table_wrapper_has_relative_class which renders a bare Table component and asserts the wrapper div contains class="relative w-full overflow-auto".

Test plan

  • bundle exec rake test — 75 runs, 328 assertions, 0 failures, 0 errors, 0 skips
  • bundle exec rake standard — 303 files inspected, no offenses detected

Adds a dedicated test to verify that the Table component renders its
wrapper div with class="relative w-full overflow-auto", ensuring
regression coverage for RUI-5.

Fixes: RUI-5
@djalmaaraujo djalmaaraujo requested a review from cirdes as a code owner February 26, 2026 17:41
@djalmaaraujo djalmaaraujo deleted the djalma/rui-5-table-relative branch February 26, 2026 17:54
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.

1 participant