Skip to content

Commit

Permalink
Move Heading component to staff feature flag (#4915)
Browse files Browse the repository at this point in the history
* Move Heading component to staff feature flag

* Create dull-dolphins-bake.md
  • Loading branch information
jonrohan committed Sep 4, 2024
1 parent 7a24a01 commit 69922d1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-dolphins-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move Heading component to staff feature flag
4 changes: 2 additions & 2 deletions e2e/components/Heading.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test.describe('Heading', () => {
id: story.id,
globals: {
featureFlags: {
primer_react_css_modules_team: true,
primer_react_css_modules_staff: true,
},
},
})
Expand All @@ -51,7 +51,7 @@ test.describe('Heading', () => {
id: story.id,
globals: {
featureFlags: {
primer_react_css_modules_team: true,
primer_react_css_modules_staff: true,
},
},
})
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/Heading/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const StyledHeading = styled.h2<StyledHeadingProps>`
`

const Heading = forwardRef(({as: Component = 'h2', className, variant, ...props}, forwardedRef) => {
const enabled = useFeatureFlag('primer_react_css_modules_team')
const enabled = useFeatureFlag('primer_react_css_modules_staff')
const innerRef = React.useRef<HTMLHeadingElement>(null)
useRefObjectAsForwardedRef(forwardedRef, innerRef)

Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/Heading/__tests__/Heading.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ describe('Heading', () => {
).toHaveStyleRule('font-style', 'italic')
})

describe('with primer_react_css_modules_team enabled', () => {
describe('with primer_react_css_modules_staff enabled', () => {
it('should only include css modules class', () => {
HTMLRender(
<FeatureFlags
flags={{
primer_react_css_modules_team: true,
primer_react_css_modules_staff: true,
}}
>
<Heading>test</Heading>
Expand All @@ -163,7 +163,7 @@ describe('Heading', () => {
const {container} = HTMLRender(
<FeatureFlags
flags={{
primer_react_css_modules_team: true,
primer_react_css_modules_staff: true,
}}
>
<Heading className="test">test</Heading>
Expand All @@ -176,7 +176,7 @@ describe('Heading', () => {
HTMLRender(
<FeatureFlags
flags={{
primer_react_css_modules_team: true,
primer_react_css_modules_staff: true,
}}
>
<Heading
Expand Down

0 comments on commit 69922d1

Please sign in to comment.