-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Fixes #25276
Test Fixes #25276
Conversation
Build Results: |
CI Results: |
await click('[data-test-copy-icon]'); | ||
assert | ||
.dom('flight-icon-clipboard-checked') | ||
.exists('clicking copy icon copies value to clipboard', 'copy is successful when value is an object'); |
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 test was originally failing from an unfound selector and the selector should be [data-test-copy-button]
. After updating however, the assertion failed since a different icon was displaying after the button was clicked. I paused the test and it was a red x icon. I'm guessing that the HDS copy button component had an issue copying to the clipboard in the test environment. In any case it feels like that functionality is not the concern of the masked input so I removed the click and assertion.
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.
Sometimes the copy button requires a container - the component still works in the app, right?
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.
Yes it does. It actually works in the test after it has been paused and you manually click it again too.
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.
It looks like the test was actually added recently, so I wonder if it's not copying the value as expected? https://github.com/hashicorp/vault/pull/25269/files
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.
I noticed on second glance that the flight-icon-clipboard-checked
selector was missing the .
since it was a class but even after updating that it just does not pass locally or on CI which must be a test environment issue since it is working in the app.
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.
Pausing the test seems to confirm this. The first click happens from within the test and you can see the icon changes to a failure state. Since the test is paused it's almost like the navigator API becomes available and when I click it again manually it works.
Screen.Recording.2024-02-07.at.3.31.58.PM.mov
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.
Thanks, LGTM!
* fixes masked-input component throwing error when there is no value * removes copy button assertions from masked input test * reverts masked input assertion removal and updates test selectors
There was an issue where the test-ui GH action was being skipped but the check was reporting as passed which led to some PR's being merged that had failures and this PR fixes them.