Skip to content

feat(angular-ngrx-scss): Create main layout (Top repos + Gists)#319

Merged
SDaian merged 8 commits intomainfrom
fix/issue-117
Jul 7, 2022
Merged

feat(angular-ngrx-scss): Create main layout (Top repos + Gists)#319
SDaian merged 8 commits intomainfrom
fix/issue-117

Conversation

@SDaian
Copy link
Contributor

@SDaian SDaian commented May 27, 2022

Description

  • Get Gists from GitHub API
  • Create main page layout (Top repositories + gists)

Fixes: #117
Fixes: #106
Fixes: #108

Screenshots

image

image

@SDaian SDaian self-assigned this May 27, 2022
@SDaian SDaian added this to the Angular + NgRx + SCSS milestone May 27, 2022
@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-319.dbm2zhgk5abrj.amplifyapp.com

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-319.d1190gmno2hljg.amplifyapp.com

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-319.d3jint31f72euh.amplifyapp.com

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-319.d3sqkonra6x7y9.amplifyapp.com

@SDaian SDaian requested review from Amdrel and lindakatcodes June 17, 2022 19:12
@SDaian SDaian changed the title feat(angular-ngrx-scss): Get gists from Github API feat(angular-ngrx-scss): Create main layout (Top repos + Gists) Jun 17, 2022
Copy link
Member

@Amdrel Amdrel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

@lindakatcodes lindakatcodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few questions and requests for you. :) Let me know if there's anything that's not clear!

@SDaian SDaian force-pushed the fix/issue-117 branch 3 times, most recently from c227cdc to 8138748 Compare June 23, 2022 02:44
@SDaian SDaian requested review from Amdrel and lindakatcodes June 23, 2022 02:49
},
},
];
httpClientSpy.get.and.returnValue(of(expectedHttpResponse).pipe(delay(0)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why is this .pipe(delay(0)) needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, since now the observables are handled from the fakeAsync approach.


userService.getUserGists(username).subscribe((res) => {
expect(res).toEqual(expectedResponse);
done();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@Amdrel Amdrel Jul 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this though. Maybe subscriptions work differently in tests and it will bail out intelligently when an error throws.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@SDaian SDaian requested review from Amdrel and ihardz July 4, 2022 10:19
@SDaian SDaian merged commit a637c22 into main Jul 7, 2022
@SDaian SDaian deleted the fix/issue-117 branch July 7, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants