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

test: successful login with weak or strong password #9858

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Conversation

johnkim-det
Copy link
Contributor

@johnkim-det johnkim-det commented Aug 22, 2024

Ticket

CM-432

Description

Add unit testing to DeterminedAuth to test:

  • Successful login with strong password (no weak password warning toast)
  • Successful login with weak password (with weak password warning toast)

Test Plan

No additional testing required, unit test should pass.

Checklist

  • Changes have been manually QA'd
  • New features have been approved by the corresponding PM
  • User-facing API changes have the "User-facing API Change" label
  • Release notes have been added as a separate file under docs/release-notes/
    See Release Note for details.
  • Licenses have been included for new code which was copied and/or modified from any external code

@johnkim-det johnkim-det requested a review from a team as a code owner August 22, 2024 17:15
@johnkim-det johnkim-det requested a review from EmilyBonar August 22, 2024 17:15
@cla-bot cla-bot bot added the cla-signed label Aug 22, 2024
Copy link

netlify bot commented Aug 22, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit a77e410
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66ccc447c0b2f5000852cdb7
😎 Deploy Preview https://deploy-preview-9858--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@johnkim-det johnkim-det requested a review from maxrussell August 22, 2024 17:15
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.69%. Comparing base (707ad07) to head (a77e410).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9858      +/-   ##
==========================================
- Coverage   54.71%   50.69%   -4.02%     
==========================================
  Files        1261      938     -323     
  Lines      155988   126646   -29342     
  Branches     3590     3605      +15     
==========================================
- Hits        85342    64204   -21138     
+ Misses      70514    62311    -8203     
+ Partials      132      131       -1     
Flag Coverage Δ
harness ?
web 54.70% <100.00%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
webui/react/src/components/DeterminedAuth.tsx 91.97% <100.00%> (+91.97%) ⬆️

... and 327 files with indirect coverage changes

Copy link
Contributor

@maxrussell maxrussell left a comment

Choose a reason for hiding this comment

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

Suggestion, but LGTM with or without it.

});
});

it('logs in with weak password', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: more descriptive description can make it easier/quicker to diagnose CI failures.

Suggested change
it('logs in with weak password', async () => {
it('logs in with warning when using a weak password', async () => {

Copy link
Contributor

@EmilyBonar EmilyBonar left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +50 to +56
await waitFor(() => {
// onFinish begins:
expect(screen.getByRole('button')).toBeDisabled();
});
await waitFor(() => {
// onFinish ends:
expect(screen.getByRole('button')).not.toBeDisabled();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this part isn't in the weak password test, it should probably be in both or neither

Copy link
Contributor

@keita-determined keita-determined left a comment

Choose a reason for hiding this comment

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

there are invalid test cases

@johnkim-det johnkim-det merged commit ee269c8 into main Aug 27, 2024
86 of 99 checks passed
@johnkim-det johnkim-det deleted the CM-432 branch August 27, 2024 17:51
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.

4 participants