Skip to content

Instantly share code, notes, and snippets.

@IAfanasovMob
Last active October 8, 2019 11:59
Show Gist options
  • Save IAfanasovMob/c997705b89d9b0ab50a8084e5199b542 to your computer and use it in GitHub Desktop.
Save IAfanasovMob/c997705b89d9b0ab50a8084e5199b542 to your computer and use it in GitHub Desktop.
it('should save list of starred repos from GitHub API when response received', () => {
component.userName = 'IAfanasov';
const repos: Repo[] = [{
id: 1,
created_at: '22-09-2019',
name: 'mock',
stargazers_count: 1000,
updated_at: '30-09-2019'
}];
fixture.debugElement.query(By.css('button')).nativeElement.click();
const request = httpMock.expectOne('https://api.github.com/users/IAfanasov/starred');
request.flush(repos);
expect(component.repos).toEqual(repos);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment