import countries from '../../data/countries';

import { excludeCountries } from './excludeCountries';

describe('Exclude countries', () => {
  it('should return all the countries of list is empty', () => {
    const remove: string[] = [];
    const filteredCountries = excludeCountries(countries, remove);
    expect(filteredCountries).toHaveLength(countries.length);
  });

  it('should remove the specified countries from the list', () => {
    const remove = ['USA', 'EGY'];
    const filteredCountries = excludeCountries(countries, remove);
    expect(filteredCountries).toHaveLength(countries.length - 2);
  });

  it('should remove countries with multiple entries', () => {
    const remove = ['DOM'];
    const filteredCountries = excludeCountries(countries, remove);
    expect(filteredCountries).toHaveLength(countries.length - 3);
  });
});
