import getProjectsWithAdopters from '../../eclipsefdn.adopters';
import adoptersMockData from './mock/adopters-data.json';
import 'isomorphic-fetch';

global.fetch = jest.fn(() => 
    Promise.resolve({
        headers: new Headers({ Link: 'testing' }),
        json: () => Promise.resolve(adoptersMockData)
    })
);

describe('Adopters API', () => {
    it('Fetches adopters', async () => {
        const result = await getProjectsWithAdopters('internet-of-things');
        
        expect(result).toEqual(adoptersMockData);
    });
});
