Skip to content

Commit

Permalink
Fix component and CSS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron committed Oct 2, 2024
1 parent 19fd525 commit 694de54
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 39 deletions.
32 changes: 0 additions & 32 deletions app/components/primer/alpha/stack.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -285,36 +285,4 @@
flex-wrap: nowrap;
}
}
}

.StackItem {
flex: 0 1 auto;
min-inline-size: 0;

&[data-grow='true'],
&[data-grow-narrow='true'] {
flex-grow: 1;
}

/* @custom-media --veiwportRange-regular */
@media (min-width: 48rem) {
&[data-grow-regular='true'] {
flex-grow: 1;
}

&[data-grow-regular='false'] {
flex-grow: 0;
}
}

/* @custom-media --viewportRange-wide */
@media (min-width: 87.5rem) {
&[data-grow-wide='true'] {
flex-grow: 1;
}

&[data-grow-wide='false'] {
flex-grow: 0;
}
}
}
31 changes: 31 additions & 0 deletions app/components/primer/alpha/stack_item.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.StackItem {
flex: 0 1 auto;
min-inline-size: 0;

&[data-grow='true'],
&[data-grow-narrow='true'] {
flex-grow: 1;
}

/* @custom-media --veiwportRange-regular */
@media (min-width: 48rem) {
&[data-grow-regular='true'] {
flex-grow: 1;
}

&[data-grow-regular='false'] {
flex-grow: 0;
}
}

/* @custom-media --viewportRange-wide */
@media (min-width: 87.5rem) {
&[data-grow-wide='true'] {
flex-grow: 1;
}

&[data-grow-wide='false'] {
flex-grow: 0;
}
}
}
11 changes: 6 additions & 5 deletions app/components/primer/primer.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
@import "./alpha/action_list.pcss";
@import "./alpha/auto_complete.pcss";
@import "./alpha/banner.pcss";
@import "./alpha/button_marketing.pcss";
@import "./alpha/dialog.pcss";
@import "./alpha/dropdown.pcss";
@import "./alpha/layout.pcss";
@import "./alpha/menu.pcss";
@import "./alpha/segmented_control.pcss";
@import "./alpha/select_panel.pcss";
@import "./alpha/stack.pcss";
@import "./alpha/stack_item.pcss";
@import "./alpha/tab_nav.pcss";
@import "./alpha/text_field.pcss";
@import "./alpha/button_marketing.pcss";
@import "./alpha/toggle_switch.pcss";
@import "./alpha/underline_nav.pcss";
@import "./alpha/select_panel.pcss";
@import "./alpha/segmented_control.pcss";
@import "./alpha/menu.pcss";
@import "./alpha/stack.pcss";

/* beta */
@import "./beta/avatar.pcss";
Expand Down
7 changes: 5 additions & 2 deletions test/components/component_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ class PrimerComponentTest < Minitest::Test
[Primer::Alpha::Banner, {}],
[Primer::Alpha::FormControl, { label: "Foo" }],
[Primer::Alpha::ActionMenu, {}, proc { |component| component.with_item(label: "Do something", value: "") }],
[Primer::Alpha::SelectPanel, {}]
[Primer::Alpha::SelectPanel, {}],
[Primer::Alpha::Stack, {}],
[Primer::Alpha::StackItem, {}]
].freeze

def test_registered_components
Expand All @@ -155,7 +157,8 @@ def test_registered_components
"Primer::Alpha::OcticonSymbols",
"Primer::Component",
"Primer::Content",
"Primer::Navigation::TabComponent"
"Primer::Navigation::TabComponent",
"Primer::ResponsiveArg"
]

primer_component_files_count = Dir["app/components/**/*.rb"].count { |p| p.exclude?("/experimental/") }
Expand Down

0 comments on commit 694de54

Please sign in to comment.