import { render, screen } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import { CampaignHomeLayout } from '@/components/campaign/dashboard/CampaignHomeLayout'
describe('CampaignHomeLayout', () => {
it('fills the scrollport height on mobile', () => {
const { container } = render(
Search stub
} />, ) const search = screen.getByTestId('home-search-stub').closest('[data-slot="home-search"]') expect(search).not.toBeNull() expect(search?.closest('[data-slot="home-dock"]')).not.toBeNull() }) it('omits search slot when not provided', () => { const { container } = render(Search stub
} summarySlot={Summary stub
} />, ) const homeChrome = container.querySelector('[data-slot="home-chrome"]') expect(homeChrome?.getAttribute('data-retracted')).toBe('true') expect(homeChrome?.className).toContain('grid-rows-[0fr]') expect(homeChrome?.className).toContain('opacity-0') const actionsChrome = container.querySelector('[data-slot="home-actions-chrome"]') expect(actionsChrome?.getAttribute('data-retracted')).toBe('true') expect(actionsChrome?.className).toContain('grid-rows-[0fr]') expect(container.querySelector('[data-slot="home-thumb-spacer"]')).not.toBeNull() expect(container.querySelector('[data-slot="home-summary"]')).not.toBeNull() expect(container.querySelector('[data-slot="home-actions"]')).not.toBeNull() expect(container.querySelector('[data-slot="home-search"]')).not.toBeNull() expect(container.querySelector('[data-slot="home-dock"]')).not.toBeNull() }) })