-
Notifications
You must be signed in to change notification settings - Fork 671
CounterLabel: Deprecated scheme prop in favor of variant prop #7185
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
Changes from 2 commits
6b61f17
e3ca6ec
c0f4642
6e544c8
0517d2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': minor | ||
| --- | ||
|
|
||
| CounterLabel: Deprecated scheme prop in favor of variant prop | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,13 +23,25 @@ describe('CounterLabel', () => { | |
| expect(container.firstChild).toHaveAttribute('aria-hidden', 'true') | ||
| }) | ||
|
|
||
| it('respects the primary "variant" prop', () => { | ||
| const {container} = HTMLRender(<CounterLabel variant="primary">1234</CounterLabel>) | ||
| expect(container.firstChild).toBeInTheDocument() | ||
| expect(container.firstChild).toHaveTextContent('1234') | ||
| }) | ||
|
|
||
| it('respects the secondary "variant" prop', () => { | ||
| const {container} = HTMLRender(<CounterLabel variant="secondary">1234</CounterLabel>) | ||
| expect(container.firstChild).toBeInTheDocument() | ||
| expect(container.firstChild).toHaveTextContent('1234') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both of the added tests check for the same thing 🤔 What are we testing here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. I somehow just copied the old tests and didn't get that they don't quite make sense. |
||
| }) | ||
|
|
||
| it('respects the primary "scheme" prop', () => { | ||
| const {container} = HTMLRender(<CounterLabel scheme="primary">1234</CounterLabel>) | ||
| expect(container.firstChild).toBeInTheDocument() | ||
| expect(container.firstChild).toHaveTextContent('1234') | ||
| }) | ||
|
|
||
| it('renders with secondary scheme when no "scheme" prop is provided', () => { | ||
| it('renders with secondary variant when no "scheme" or "variant" prop is provided', () => { | ||
| const {container} = HTMLRender(<CounterLabel>1234</CounterLabel>) | ||
| expect(container.firstChild).toBeInTheDocument() | ||
| expect(container.firstChild).toHaveTextContent('1234') | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.