Last active
October 8, 2019 11:59
-
-
Save IAfanasovMob/c997705b89d9b0ab50a8084e5199b542 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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