Skip to content

Conversation

lane-wetmore
Copy link
Contributor

@lane-wetmore lane-wetmore commented Mar 13, 2025

Description

This PR updates the totp key creation page to match our design. It also introduces related tests.

image

TODO only if you're a HashiCorp employee

  • Backport Labels: If this fix needs to be backported, use the appropriate backport/ label that matches the desired release branch. Note that in the CE repo, the latest release branch will look like backport/x.x.x, but older release branches will be backport/ent/x.x.x+ent.
    • LTS: If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    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.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@lane-wetmore lane-wetmore self-assigned this Mar 13, 2025
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Mar 13, 2025
Copy link

github-actions bot commented Mar 13, 2025

CI Results:
All Go tests succeeded! ✅

@lane-wetmore lane-wetmore changed the title UI/vault 34068 totp key creation design UI: Update TOTP key creation page Mar 13, 2025
Copy link
Contributor

@hellobontempo hellobontempo left a 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 ✨

const flashMessage = create(fm);

const SELECTORS = {
menuItem: (item) => `[data-test-popup-menu="${item}"]`,
Copy link
Contributor

@hellobontempo hellobontempo Mar 20, 2025

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.`,
Copy link
Contributor

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.

Copy link
Contributor

@hellobontempo hellobontempo left a 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.

Copy link
Contributor

@hellobontempo hellobontempo left a 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 ✅

@lane-wetmore lane-wetmore merged commit f5b4dfc into ui-totp-sidebranch Mar 21, 2025
25 checks passed
@lane-wetmore lane-wetmore deleted the ui/VAULT-34068-totp-key-creation-design branch March 21, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants