-
Notifications
You must be signed in to change notification settings - Fork 4.4k
UI: Update TOTP key creation page #29916
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
UI: Update TOTP key creation page #29916
Conversation
CI Results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work so far! Left some comments ✨
ui/tests/integration/components/totp/page/totp-list-item-test.js
Outdated
Show resolved
Hide resolved
ui/tests/integration/components/totp/page/totp-list-item-test.js
Outdated
Show resolved
Hide resolved
const flashMessage = create(fm); | ||
|
||
const SELECTORS = { | ||
menuItem: (item) => `[data-test-popup-menu="${item}"]`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this could be a pattern reused more, it might be nice to add it below the menuTrigger here to the general-selectors
assert.dom(SES.secretLink(this.keyName)).doesNotExist(`${this.keyName}: key is no longer in the list`); | ||
assert.strictEqual( | ||
flashMessage.latestMessage, | ||
`${this.keyName} was successfully deleted.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this success flash is different than the details view, we should be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! This is so close!
I think we're still missing an acceptance test that checks the QR code shows when generate and exported are true. Plus component tests - are you planning on adding those in a follow-on PR? Ideally it'd be nice to have them with this work, but if you want to do it iteratively since this isn't going directly to main that's fine 😄
Here's a decent example of a basic form integration test. What we want to achieve via component tests is checking error handling, validations and that submit requests go to the expected endpoint. Basically does the form component do what it should do.
Since the toggle and QR components are small, I think it's okay that the toggle group tests be included in the integration test (so do the right groups show when generate is true, etc) And the QR component can just be tested by the acceptance test - that seems sufficient since it's just a display template and isn't managing any logic internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Really nice job cleaning up this logic and making things nice and readable. Once tests are passing this is good to merge ✅
Description
This PR updates the totp key creation page to match our design. It also introduces related tests.
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.