-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adding new StudioHeading #15064
Conversation
Warning Rate limit exceeded@wrt95 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 47 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new Changes
Suggested labels
Suggested reviewers
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.test.tsx (1)
24-27
: Consider testing default level valueWhile you test the default data-size and custom level, there's no test to verify the default level is 2 (as implied by your getHeading function default).
it('applies custom level prop correctly', () => { renderStudioHeading({ level: 1 }); expect(getHeading(mockHeading, 1)).toBeInTheDocument(); }); + it('applies default level correctly', () => { + renderStudioHeading(); + expect(screen.getByRole('heading', { name: mockHeading, level: 2 })).toBeInTheDocument(); + });frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.tsx (1)
4-16
: Consider adding JSDoc comments to the componentThe component lacks documentation that explains its purpose and usage. Adding JSDoc comments would improve discoverability and help other developers understand how to use this component.
import React from 'react'; import { Heading, HeadingProps } from '@digdir/designsystemet-react'; +/** + * Props for the StudioHeading component + */ export type StudioHeadingProps = HeadingProps; +/** + * StudioHeading component + * + * A wrapper around the Heading component from designsystemet-react + * with a default data-size of 'sm' that can be overridden. + */ export const StudioHeading = ({ children, 'data-size': dataSize = 'sm', ...rest }: StudioHeadingProps) => { return ( <Heading {...rest} data-size={dataSize}> {children} </Heading> ); };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.test.tsx
(1 hunks)frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.tsx
(1 hunks)frontend/libs/studio-components/src/components/StudioHeading/index.ts
(1 hunks)frontend/libs/studio-components/src/components/index.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Build environment and run e2e test
- GitHub Check: Testing
🔇 Additional comments (2)
frontend/libs/studio-components/src/components/StudioHeading/index.ts (1)
1-2
: LGTM! Index file exports the StudioHeading component correctlyThe index file correctly exports the StudioHeading component, following the barrel pattern for component organization.
frontend/libs/studio-components/src/components/index.ts (1)
1-2
: LGTM! Component properly exported from the main index fileThe StudioHeading component is correctly exported from the main components index file, replacing the previous placeholder export.
frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.test.tsx
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15064 +/- ##
=======================================
Coverage 95.93% 95.93%
=======================================
Files 1995 1996 +1
Lines 25864 25869 +5
Branches 2920 2921 +1
=======================================
+ Hits 24812 24817 +5
Misses 788 788
Partials 264 264 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.test.tsx
Outdated
Show resolved
Hide resolved
frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.test.tsx
Outdated
Show resolved
Hide resolved
frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.test.tsx
Outdated
Show resolved
Hide resolved
frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.test.tsx
Outdated
Show resolved
Hide resolved
frontend/libs/studio-components/src/components/StudioHeading/StudioHeading.test.tsx
Outdated
Show resolved
Hide resolved
…n-studio into feat--add-new-StudioHeading
Description
StudioHeading
componentRelated Issue(s)
Verification
Summary by CodeRabbit
New Features
Tests
Chores
Types