import { render, screen } from '@testing-library/react'; import type React from 'react'; import { describe, expect, it, vi } from 'vitest'; import { SwapSettingsSlippageDescription } from './SwapSettingsSlippageDescription'; import { SwapSettingsSlippageInput } from './SwapSettingsSlippageInput'; import { SwapSettingsSlippageLayout } from './SwapSettingsSlippageLayout'; import { SwapSettingsSlippageTitle } from './SwapSettingsSlippageTitle'; vi.mock('./SwapSettingsSlippageTitle', () => ({ SwapSettingsSlippageTitle: ({ children }: { children: React.ReactNode }) => (
{children}
), })); vi.mock('./SwapSettingsSlippageDescription', () => ({ SwapSettingsSlippageDescription: ({ children, }: { children: React.ReactNode; }) =>
{children}
, })); vi.mock('./SwapSettingsSlippageInput', () => ({ SwapSettingsSlippageInput: () =>
Input
, })); vi.mock('../styles/theme', () => ({ cn: (...args: string[]) => args.join(' '), background: { default: 'bg-default' }, border: { default: 'border-default' }, pressable: { shadow: 'pressable-shadow' }, })); describe('SwapSettingsSlippageLayout', () => { it('renders with all child components', () => { render( Title Description , ); expect( screen.getByTestId('ockSwapSettingsLayout_container'), ).toBeInTheDocument(); expect(screen.getByTestId('mock-title')).toBeInTheDocument(); expect(screen.getByTestId('mock-description')).toBeInTheDocument(); expect(screen.getByTestId('mock-input')).toBeInTheDocument(); }); });