import { validate } from 'class-validator';
import { BatchIdsDto } from './batch-ids.dto';

describe('BatchIdsDto', () => {
  it.each([
    { ids: [] },
    { ids: [0] },
    { ids: [-1] },
    { ids: [1.5] },
    { ids: ['1'] },
  ])('rejects invalid ids: $ids', async ({ ids }) => {
    const dto = Object.assign(new BatchIdsDto(), { ids });
    await expect(validate(dto)).resolves.not.toHaveLength(0);
  });

  it('allows duplicate positive integer ids for service-level normalization', async () => {
    const dto = Object.assign(new BatchIdsDto(), { ids: [1, 1, 2] });
    await expect(validate(dto)).resolves.toHaveLength(0);
  });
});
