import { CityNamePipe } from './city-name.pipe';
import { DictionariesService } from '@modules/components/page-filters/services/dictionaries-service';
describe('CityNamePipe', () => {
    const dictionaries: DictionariesService = {
        getCityOrAirport: jasmine
            .createSpy('getCityOrAirport')
            .withArgs('MOW')
            .and.returnValue({ name: 'Moscow' })
            .withArgs(null)
            .and.returnValue({ name: '' })
            .withArgs('LED')
            .and.returnValue(undefined),
    } as any;

    it('should resolve city', () => {
        const pipe = new CityNamePipe(dictionaries);
        expect(pipe.transform('MOW')).toBe('Moscow');
        expect(pipe.transform(null)).toBe('');
        expect(pipe.transform('LED')).toBe(undefined);
    });
});
