@navinc/base-react-components
Version:
Nav's Pattern Library
16 lines • 749 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { describe, expect, it } from 'vitest';
import { screen } from '@testing-library/react';
import { Button } from './button.js';
import { renderWithContext } from './tests/with-app-context.js';
describe('<Button />', () => {
it('renders LoadingDots if its loading', () => {
renderWithContext(_jsx(Button, { isLoading: true, children: "button me" }));
expect(screen.getByTestId('button-loading-dots')).toBeInTheDocument();
});
it('renders the children if its not loading', () => {
renderWithContext(_jsx(Button, { children: "button me" }));
expect(screen.getByText(/button me/i)).toBeInTheDocument();
});
});
//# sourceMappingURL=button.spec.js.map