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

UI: dashboard acceptance tests for quick actions, client count, replication #22475

Merged
merged 42 commits into from
Aug 24, 2023

Conversation

kiannaquach
Copy link
Contributor

@kiannaquach kiannaquach commented Aug 21, 2023

Description

  • Acceptance tests for quick actions, client count, replication, and integration test for replication-state-text.js.
  • Added the period for the feedback form to be after the icon
Screenshot 2023-08-23 at 9 57 09 AM

Other things added:

  • kv tests + update to the quick actions kv model, update the id to have kv version 1/2
Screenshot 2023-08-23 at 11 24 08 AM
  • some small ui changes: hide show all button for secrets engines card when list < 5
Screenshot 2023-08-23 at 12 30 30 PM

@kiannaquach kiannaquach added this to the 1.15 milestone Aug 21, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Aug 21, 2023
@kiannaquach kiannaquach marked this pull request as ready for review August 23, 2023 17:50
@github-actions
Copy link

Build Results:
All builds succeeded! ✅

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.

Looks good! Just some suggestions about renaming some selectors to make them more reusable - but nothing blocking! 🚀

Copy link
Contributor

Choose a reason for hiding this comment

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

Do all of the getters and things update as expected? I know sometimes ember has trouble tracking nested values if tracked properties are objects. It looks like tests would account for that, but just wanted to check 😄

Copy link
Contributor Author

@kiannaquach kiannaquach Aug 23, 2023

Choose a reason for hiding this comment

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

@hellobontempo I was concerned about that too! Do you think I should move it back to individual tracked properties? From my manual qa and my acceptance tests, everything works as intended, but I'm paranoid

Copy link
Contributor

Choose a reason for hiding this comment

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

If I remember correctly - all of your getters recompute because of the selected engine 🤔

I think as long as you're not expecting the view to change based just the key value of the object, then we should be good!

ui/app/controllers/vault/cluster/dashboard.js Show resolved Hide resolved
<EmptyState
@title="No mount selected"
@message="Select a mount above to get started."
data-test-no-mount-selected-empty
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like you could use the empty state component test selectors and just reuse those in your test file?

@@ -2,7 +2,7 @@
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
<Hds::Card::Container @hasBorder={{true}} class="has-padding-l has-bottom-padding-m">
<Hds::Card::Container @hasBorder={{true}} class="has-padding-l has-bottom-padding-m" data-test-replication-card>
Copy link
Contributor

Choose a reason for hiding this comment

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

if this selector is something like data-test-card="replication" the same selector could be reused for your other cards in tests

SELECTORS = {
...
card: (name) => `[data-test-card="${name}"]`
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out and great idea! I will make a follow up ticket!

assert.dom('[data-test-secrets-engines-select]').exists({ count: 1 });
assert.dom('[data-test-component="empty-state"]').exists({ count: 1 });
assert.dom(SELECTORS.secretsEnginesSelect).exists({ count: 1 });
assert.dom(SELECTORS.emptyState).exists({ count: 1 });
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 asserting the empty state message and/or title have the correct text is a more honest check that the UI renders as expected

@kiannaquach kiannaquach merged commit bc77db7 into ui/landing-page-dashboard Aug 24, 2023
55 checks passed
@kiannaquach kiannaquach deleted the ui/VAULT-18885/acceptance-test branch August 24, 2023 05:55
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 pr/no-changelog ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants