Skip to content
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:badge icon completed #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat:badge icon completed #4

wants to merge 1 commit into from

Conversation

asifmehmood101
Copy link
Collaborator

image
image

@asifmehmood101
Copy link
Collaborator Author

@Safei-Ashraf please review it ad let me know

src/components/Badge/Badge.d.ts Show resolved Hide resolved
src/components/Badge/Badge.stories.tsx Show resolved Hide resolved
it('render Badge with default text content', () => {
const text = 'Welcome to Badge Component';
render(<Badge size={24} name="star" color="red" />);
expect(screen.getByText(text)).toBeInTheDocument();
Copy link
Owner

Choose a reason for hiding this comment

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

use tailwind custom classes sm, md ,..etc and test for them in the document,
e.g size = "sm" => test case that looks for sm in the document, you don't need to cover all variations, 2 is enough

src/components/Badge/Badge.test.tsx Show resolved Hide resolved
color = 'currentColor',
...rest
}: BadgeProps): JSX.Element => {
const icons = {
Copy link
Owner

Choose a reason for hiding this comment

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

store the icon in a separate file, as its own component, refer to Star Icon for example, you can use the same icon/component here.

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.

2 participants