Created
August 19, 2017 15:32
-
-
Save cironunes/838e9a2e88f12baa567be3e59f47fe1f 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 return an Observable<SearchResults>', () => { | |
service.search('users', dummyParams) | |
.subscribe(result => { | |
expect(result.items.length).toBe(2); | |
}); | |
const req = httpMock.expectOne(`${service.API_URL}/search/users?q=cironunes`); | |
expect(req.request.url).toBe(`${service.API_URL}/search/users`); | |
expect(req.request.params).toEqual(dummyParams); | |
req.flush({ | |
incomplete_results: false, | |
items: [{}, {}], | |
total_count: 2 | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment