import { describe, it, expect } from 'vitest'; import { render, screen } from '@testing-library/react'; import { ShiftCard } from '../shifts/shift-card'; describe('ShiftCard', () => { it('shows capacity correctly (2/3 spots filled)', () => { render( ); expect(screen.getByText('2/3 spots filled')).toBeInTheDocument(); }); it('disables sign-up button when full', () => { render( ); expect(screen.getByText('3/3 spots filled')).toBeInTheDocument(); expect(screen.queryByRole('button', { name: 'Sign Up' })).not.toBeInTheDocument(); }); it('shows "Past" badge and no sign-up button for past shifts', () => { render( ); expect(screen.getByText('Past')).toBeInTheDocument(); expect(screen.queryByRole('button', { name: 'Sign Up' })).not.toBeInTheDocument(); }); });