diff --git a/.bitmap b/.bitmap index cde7bac..0f67652 100644 --- a/.bitmap +++ b/.bitmap @@ -26,7 +26,7 @@ "ui/button": { "name": "ui/button", "scope": "automations.design", - "version": "0.0.7", + "version": "c2f7b3e45b5a5f67719c25188f6072e33e8a8f29", "mainFile": "index.ts", "rootDir": "bit-components/design/ui/button" }, @@ -51,5 +51,12 @@ "mainFile": "index.ts", "rootDir": "bit-components/design/ui/input" }, - "$schema-version": "17.0.0" + "$schema-version": "17.0.0", + "_bit_lane": { + "id": { + "name": "update-button-tests", + "scope": "automations.design" + }, + "exported": true + } } \ No newline at end of file diff --git a/bit-components/design/ui/button/button.spec.tsx b/bit-components/design/ui/button/button.spec.tsx index 9955485..db67a20 100644 --- a/bit-components/design/ui/button/button.spec.tsx +++ b/bit-components/design/ui/button/button.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { render, screen, fireEvent } from '@testing-library/react'; -import { Button } from './button.js'; import { vi } from 'vitest'; +import { Button } from './button.js'; describe('Button', () => { it('renders children correctly', () => { @@ -56,7 +56,7 @@ describe('Button', () => { }); it('renders icon correctly', () => { - const icon = 🚀; + const icon = 🚀; render(); expect(screen.getByTestId('test-icon')).toBeInTheDocument(); }); @@ -68,7 +68,7 @@ describe('Button', () => { }); it('hides icons when in loading state', () => { - const icon = 🚀; + const icon = 🚀; render(); expect(screen.queryByTestId('test-icon')).not.toBeInTheDocument(); }); @@ -88,4 +88,22 @@ describe('Button', () => { rerender(); expect(screen.getByRole('button')).toHaveAttribute('type', 'reset'); }); + + it('applies multiple props correctly when combined', () => { + render( + + ); + + const button = screen.getByTestId('combined-button'); + expect(button).toHaveClass('danger'); + expect(button).toHaveClass('large'); + expect(button).toHaveAttribute('type', 'button'); // default type + expect(screen.getByText('Delete Item')).toBeInTheDocument(); + }); });