Skip to content

Commit

Permalink
Update button story and test
Browse files Browse the repository at this point in the history
  • Loading branch information
cgero-eth committed Sep 20, 2023
1 parent e544966 commit 4b22476
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/button/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const Default: Story = {
args: {
variant: 'primary',
size: 'lg',
children: 'Default',
children: 'Button label',
onClick: () => alert('click'),
},
};
Expand Down
6 changes: 6 additions & 0 deletions src/components/button/button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ describe('<Button /> component', () => {
render(createTestComponent());
expect(screen.getByRole('button')).toBeInTheDocument();
});

it('renders the specified button label', () => {
const children = 'Button label';
render(createTestComponent({ children }));
expect(screen.getByRole('button', { name: children })).toBeInTheDocument();
});
});

0 comments on commit 4b22476

Please sign in to comment.