import { describe, expect, it } from 'vitest';
import { collectUnreadIds } from './notificationUnread';

describe('collectUnreadIds', () => {
  it('returns numeric ids for unread items', () => {
    const ids = collectUnreadIds([
      { id: '12', is_read: false },
      { id: 5, is_read: false },
      { id: 'x', is_read: false },
      { id: 9, is_read: true },
    ]);

    expect(ids).toEqual([12, 5]);
  });

  it('returns empty array when all items are read', () => {
    const ids = collectUnreadIds([
      { id: 1, is_read: true },
      { id: '2', is_read: true },
    ]);

    expect(ids).toEqual([]);
  });
});
