Skip to content

Commit 2fbe25e

Browse files
authored
Merge pull request #3 from teambit/automations.design/update-button-docs
docs: update docs
2 parents 6071877 + 54d81a1 commit 2fbe25e

File tree

3 files changed

+7
-25
lines changed

3 files changed

+7
-25
lines changed

.bitmap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"patterns/form": {
1313
"name": "patterns/form",
1414
"scope": "automations.design",
15-
"version": "2c64d81f2c0e5a9a0a1e2e7ca698b7965295620b",
15+
"version": "02856a708c23d92a84f9c5a82e82f0a61c931211",
1616
"mainFile": "index.ts",
1717
"rootDir": "bit-components/design/patterns/form"
1818
},
@@ -26,7 +26,7 @@
2626
"ui/button": {
2727
"name": "ui/button",
2828
"scope": "automations.design",
29-
"version": "82f527944f193c46d1055d0eca7f47d9c77a264b",
29+
"version": "5dc717b3cafca203402c9ca98dd140b615c7dd8b",
3030
"mainFile": "index.ts",
3131
"rootDir": "bit-components/design/ui/button"
3232
},
@@ -54,7 +54,7 @@
5454
"$schema-version": "17.0.0",
5555
"_bit_lane": {
5656
"id": {
57-
"name": "update-button-tests",
57+
"name": "update-button-docs",
5858
"scope": "automations.design"
5959
},
6060
"exported": true

bit-components/design/ui/button/button.docs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: A Button component.
3-
labels: ['button', 'react', 'test', 'test2']
3+
labels: ['button', 'react', 'test', 'test2', 'test3']
44
---
55

66
import { Button } from './button';

bit-components/design/ui/button/button.spec.tsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { render, screen, fireEvent } from '@testing-library/react';
3-
import { vi } from 'vitest';
43
import { Button } from './button.js';
4+
import { vi } from 'vitest';
55

66
describe('Button', () => {
77
it('renders children correctly', () => {
@@ -56,7 +56,7 @@ describe('Button', () => {
5656
});
5757

5858
it('renders icon correctly', () => {
59-
const icon = <span data-testid="test-icon" role="img" aria-label="Rocket">🚀</span>;
59+
const icon = <span data-testid="test-icon">🚀</span>;
6060
render(<Button icon={icon}>Click me</Button>);
6161
expect(screen.getByTestId('test-icon')).toBeInTheDocument();
6262
});
@@ -68,7 +68,7 @@ describe('Button', () => {
6868
});
6969

7070
it('hides icons when in loading state', () => {
71-
const icon = <span data-testid="test-icon" role="img" aria-label="Rocket">🚀</span>;
71+
const icon = <span data-testid="test-icon">🚀</span>;
7272
render(<Button loading icon={icon}>Click me</Button>);
7373
expect(screen.queryByTestId('test-icon')).not.toBeInTheDocument();
7474
});
@@ -88,22 +88,4 @@ describe('Button', () => {
8888
rerender(<Button type="reset">Button</Button>);
8989
expect(screen.getByRole('button')).toHaveAttribute('type', 'reset');
9090
});
91-
92-
it('applies multiple props correctly when combined', () => {
93-
render(
94-
<Button
95-
variant="danger"
96-
size="large"
97-
data-testid="combined-button"
98-
>
99-
Delete Item
100-
</Button>
101-
);
102-
103-
const button = screen.getByTestId('combined-button');
104-
expect(button).toHaveClass('danger');
105-
expect(button).toHaveClass('large');
106-
expect(button).toHaveAttribute('type', 'button'); // default type
107-
expect(screen.getByText('Delete Item')).toBeInTheDocument();
108-
});
10991
});

0 commit comments

Comments
 (0)