Skip to content

Commit

Permalink
feat(Button): update style and add support to IconButton and MultiButton
Browse files Browse the repository at this point in the history
- extract Spinner component and export it
- add secondary action support
- use custom dimensions for internal elements based on Button size
- allow Button to contain only an icon to create an IconButton
- allow Button to container only icon and secondary action to create a MultiIconButton
- internal refactor of the component elements
- make text uppercase on css level
- update tests

refs: CDS-39 CDS-19
  • Loading branch information
beawar committed Apr 11, 2022
1 parent c66d1a0 commit 89dbb0b
Show file tree
Hide file tree
Showing 11 changed files with 585 additions and 381 deletions.
401 changes: 224 additions & 177 deletions src/components/basic/Button.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/components/basic/Button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ describe('Button', () => {
const label = faker.lorem.words(1);
const clickFn = jest.fn();
render(<Button label={label} loading onClick={clickFn} />);
expect(screen.getByText(new RegExp(label, 'i'))).toBeVisible();
expect(screen.getByText(new RegExp(label, 'i'))).toBeInTheDocument();
expect(screen.getByText(new RegExp(label, 'i'))).not.toBeVisible();
expect(screen.getByTestId('spinner')).toBeInTheDocument();
expect(screen.getByTestId('spinner')).toBeVisible();
});
Expand Down
Loading

0 comments on commit 89dbb0b

Please sign in to comment.