Skip to content

Add Badge - #75

Merged
lshig merged 2 commits into
masterfrom
shigetoshi/72/add-badge
Mar 26, 2019
Merged

lshig merged 2 commits into
masterfrom
shigetoshi/72/add-badge

Conversation

@lshig

@lshig lshig commented Mar 21, 2019

Copy link
Copy Markdown
Contributor

Related issues

This PR closes #72.

Description of changes

👋 Open to discussion/feedback!

We're currently using this Badge in the Account Dashboard and the Tokens API docs. This PR adds the new Badge component, examples, and tests. badgeText is required. There is an opinionated variation in coloring ('blue', 'orange', 'purple'). If tooltipText isn't provided, the Tooltip wrapper component isn't rendered.

Badge test cases

cc: @angel @mapbox/docs @mapbox/studio

@lshig lshig self-assigned this Mar 21, 2019
@lshig
lshig requested review from danswick and kepta March 21, 2019 22:09
testCases.colorAndTooltip.props
)
);
test('renders as expected', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I love snapshot tests, it might great to add a unit test to make sure if props.tooltipText exists, so does <Tooltip />.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kepta! I added them in 40a36d7.

@kepta kepta left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 !

A minor request to add one extra unit test.

@lshig
lshig merged commit a41bc44 into master Mar 26, 2019
@lshig
lshig deleted the shigetoshi/72/add-badge branch March 26, 2019 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Badge component

2 participants