test(table): assert wrapper div has 'relative' class (RUI-5)#348
Closed
djalmaaraujo wants to merge 1 commit intomainfrom
Closed
test(table): assert wrapper div has 'relative' class (RUI-5)#348djalmaaraujo wants to merge 1 commit intomainfrom
djalmaaraujo wants to merge 1 commit intomainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Tablecomponent wraps the<table>element in adiv. Without therelativeCSS 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-autoon the wrapperdiv) 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: Addedtest_render_table_wrapper_has_relative_classwhich renders a bareTablecomponent and asserts the wrapper div containsclass="relative w-full overflow-auto".Test plan
bundle exec rake test— 75 runs, 328 assertions, 0 failures, 0 errors, 0 skipsbundle exec rake standard— 303 files inspected, no offenses detected