import { render, screen } from '@testing-library/react';
import { describe, it, expect, vi } from 'vitest';
import { SellerTopBar } from '../seller-top-bar';

// Mock NotificationBell so the top bar test doesn't require the query client.
vi.mock('@/components/notifications/notification-bell', () => ({
  NotificationBell: ({ seeAllHref }: { seeAllHref?: string }) => (
    <div data-testid="bell" data-seeall={seeAllHref ?? ''} />
  ),
}));

describe('SellerTopBar', () => {
  it('renders store name and bell', () => {
    render(<SellerTopBar storeName="Meadow Thrift" />);

    expect(screen.getByText('Meadow Thrift')).toBeInTheDocument();
    expect(screen.getByTestId('bell')).toBeInTheDocument();
  });

  it('passes /seller/inbox as the bell see-all target', () => {
    render(<SellerTopBar storeName="Meadow Thrift" />);
    expect(screen.getByTestId('bell')).toHaveAttribute('data-seeall', '/seller/inbox');
  });
});
