import React from 'react';
import { render } from '@testing-library/react-native';
import { Toast } from '../../components/Toast';

describe('Toast', () => {
  it('renders message when visible', () => {
    const { getByText } = render(
      <Toast message="Plant saved!" isVisible={true} onClose={jest.fn()} />
    );
    expect(getByText('Plant saved!')).toBeTruthy();
  });

  it('does not render when not visible', () => {
    const { queryByText } = render(
      <Toast message="Plant saved!" isVisible={false} onClose={jest.fn()} />
    );
    expect(queryByText('Plant saved!')).toBeNull();
  });
});
