import * as React from 'react'; import { render } from '../../../../vitest/render'; import { Button } from '../../Button/Button'; import { DropdownButton } from '../../DropdownButton/DropdownButton'; import { SectionControls } from './SectionControls'; describe('SectionControls', () => { it('renders with primary button only', () => { const { container } = render( Save} secondaryButton={false} /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with primary and secondary buttons', () => { const { container } = render( Save} secondaryButton={} /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with primary, secondary, and additional buttons', () => { const { container } = render( Save} secondaryButton={} buttons={ <> } /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with help content', () => { const { container } = render( Save} secondaryButton={} help={Need help? Contact support.} /> ); expect(container).toMatchInlineSnapshot(`
Need help? Contact support.
`); }); it('renders with complex help content', () => { const { container } = render( Submit} secondaryButton={false} help={
Important: This action cannot be undone. Learn more
} /> ); expect(container).toMatchInlineSnapshot(`
Important: This action cannot be undone. Learn more
`); }); it('renders with dropdown button in additional buttons', () => { const { container } = render( Save} secondaryButton={} buttons={ } /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with null primary button', () => { const { container } = render( Cancel} /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with false secondary button', () => { const { container } = render( Save} secondaryButton={false} /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with both buttons null/false', () => { const { container } = render(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with buttons containing icons', () => { const { container } = render( Save } secondaryButton={ } buttons={ <> } /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with complex button structure', () => { const { container } = render( console.log('save')}> Save Changes } secondaryButton={ } buttons={ <> } help={
Unsaved changes will be lost. Learn about auto-save
} /> ); expect(container).toMatchInlineSnapshot(`
Unsaved changes will be lost. Learn about auto-save
`); }); it('renders with empty buttons fragment', () => { const { container } = render( Save} secondaryButton={} buttons={<>} /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with mixed button types in additional buttons', () => { const { container } = render( Submit} secondaryButton={} buttons={ <> } /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders without any buttons', () => { const { container } = render(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with only help content', () => { const { container } = render( This is help information only} /> ); expect(container).toMatchInlineSnapshot(`
This is help information only
`); }); it('renders with nested components in buttons', () => { const { container } = render( Save} secondaryButton={} buttons={
} /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders buttons with various props for dropdown conversion', () => { const { container } = render( Save} secondaryButton={ } buttons={ <> } /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with fragments in buttons', () => { const { container } = render( Submit} secondaryButton={} buttons={ <> } /> ); expect(container).toMatchInlineSnapshot(`
`); }); it('renders with complex help containing interactive elements', () => { const { container } = render( Complete Setup} secondaryButton={} help={

Complete all required fields before continuing.

} /> ); expect(container).toMatchInlineSnapshot(`

Complete all required fields before continuing.

`); }); });