Skip to content

Commit 60f8a72

Browse files
myabcclaude
andcommitted
Test deprecation warnings for box: and missing collapsible_id
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent df5e018 commit 60f8a72

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/components/primer/open_project/border_box/collapsible_header_test.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,27 @@ def test_does_not_render_with_empty_title
2121
assert_equal "Title must be present", err.message
2222
end
2323

24+
def test_warns_when_box_param_passed
25+
with_silence_deprecations(false) do
26+
::Primer::ViewComponents.deprecation.expects(:warn).with("The `box:` param is deprecated and a no-op. It will be removed in a future version.").once
27+
render_inline(Primer::OpenProject::BorderBox::CollapsibleHeader.new(
28+
collapsible_id: "body-id",
29+
box: Object.new
30+
)) do |header|
31+
header.with_title { "Backlog" }
32+
end
33+
end
34+
end
35+
36+
def test_warns_when_collapsible_id_omitted
37+
with_silence_deprecations(false) do
38+
::Primer::ViewComponents.deprecation.expects(:warn).with("Omitting the `collapsible_id` param is deprecated. It will be required in a future version.").once
39+
render_inline(Primer::OpenProject::BorderBox::CollapsibleHeader.new) do |header|
40+
header.with_title { "Backlog" }
41+
end
42+
end
43+
end
44+
2445
def test_title_renders_with_default_heading_tag
2546
render_inline(Primer::OpenProject::BorderBox::CollapsibleHeader.new(
2647
collapsible_id: "body-id"

0 commit comments

Comments
 (0)