Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add profiles component tests #971

Merged
merged 6 commits into from
Nov 13, 2022

Conversation

snss231
Copy link
Contributor

@snss231 snss231 commented Jul 19, 2022

Summary:

Fixes #601

Changes Made:

  • Add DOM test for ensuring that correct profiles are loaded into the mat-select
  • Add component test for ensuring that the right profile (name and repo name) is emitted
  • Fix import order in src/test.ts which is required to enable some test utilities (e.g. fakeAsync)

To test that the selected profile and repo name is correctly displayed, we can look into writing component tests for the sessionSelectionComponent.

Proposed Commit Message:

ProfilesComponent: add tests

Let's add tests to verify that ProfilesComponent:
- displays the right profile names in the select element
- emits the correct profile when clicked

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2022

Codecov Report

Base: 58.49% // Head: 58.03% // Decreases project coverage by -0.45% ⚠️

Coverage data is based on head (0908450) compared to base (34ef62d).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #971      +/-   ##
==========================================
- Coverage   58.49%   58.03%   -0.46%     
==========================================
  Files          98      100       +2     
  Lines        2248     2295      +47     
  Branches      255      260       +5     
==========================================
+ Hits         1315     1332      +17     
- Misses        889      917      +28     
- Partials       44       46       +2     
Impacted Files Coverage Δ
src/test.ts 100.00% <ø> (ø)
src/app/auth/profiles/profiles.component.ts 36.36% <0.00%> (ø)
...-error-dialog/json-parse-error-dialog.component.ts 33.33% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@snss231 snss231 changed the title Add profiles component DOM tests Add profiles component tests Jul 19, 2022
@gycgabriel gycgabriel requested a review from a team August 3, 2022 12:34
@gycgabriel
Copy link
Contributor

gycgabriel commented Aug 3, 2022

Need reviews from developers more familiar with tests @CATcher-org/developers

Copy link
Contributor

@kkangs0226 kkangs0226 left a comment

Choose a reason for hiding this comment

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

LGTM other than a small nitpick! 👍

});
});

it('should emit the correct profile when mat-option is clicked', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be clearer if we specify the name of the function selectProfile that is triggered when mat-option is clicked

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the spec description to should emit the correct profile through selectProfile when mat-option is clicked. Hope that is satisfactory!

Copy link
Contributor

@kkangs0226 kkangs0226 left a comment

Choose a reason for hiding this comment

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

LGTM

@kkangs0226 kkangs0226 merged commit 264f6be into CATcher-org:master Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ProfilesComponent: Add Component Tests
5 participants