feat(angular-ngrx-scss): Create main layout (Top repos + Gists)#319
feat(angular-ngrx-scss): Create main layout (Top repos + Gists)#319
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
Amdrel
left a comment
There was a problem hiding this comment.
Per Dustin's response in Slack we should aim for at least 80% code coverage (ideally 100%) in PRs. Could you write some tests for this new functionality?
lindakatcodes
left a comment
There was a problem hiding this comment.
Left a few questions and requests for you. :) Let me know if there's anything that's not clear!
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.html
Show resolved
Hide resolved
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.html
Outdated
Show resolved
Hide resolved
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.scss
Show resolved
Hide resolved
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.ts
Outdated
Show resolved
Hide resolved
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.ts
Outdated
Show resolved
Hide resolved
c227cdc to
8138748
Compare
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.html
Outdated
Show resolved
Hide resolved
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.html
Outdated
Show resolved
Hide resolved
8138748 to
804e475
Compare
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.html
Outdated
Show resolved
Hide resolved
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.scss
Show resolved
Hide resolved
| }, | ||
| }, | ||
| ]; | ||
| httpClientSpy.get.and.returnValue(of(expectedHttpResponse).pipe(delay(0))); |
There was a problem hiding this comment.
question: Why is this .pipe(delay(0)) needed?
There was a problem hiding this comment.
Removed, since now the observables are handled from the fakeAsync approach.
|
|
||
| userService.getUserGists(username).subscribe((res) => { | ||
| expect(res).toEqual(expectedResponse); | ||
| done(); |
There was a problem hiding this comment.
nitpick: We should call done() inside of the complete callback of the subscription instead of the success one. If an error happens in the observable, this test may hang and never complete.
There was a problem hiding this comment.
I haven't tested this though. Maybe subscriptions work differently in tests and it will bail out intelligently when an error throws.
There was a problem hiding this comment.
Completely agree with you @Reshurum, doing a little bit of research found this quite interesting article who mention we should avoid the done() method on the spec. because can cause some false positives and a slow performance on tests:
https://www.piotrl.net/angular-testing-avoid-done/
So basically I rewrite using fakeAsync to handle the Observables.
Description
Fixes: #117
Fixes: #106
Fixes: #108
Screenshots