-
Notifications
You must be signed in to change notification settings - Fork 38
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
e2e tests for useOverflow
logic
#2151
base: main
Are you sure you want to change the base?
Conversation
Temporarily remove unnecessary CI jobs.
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.
Are you also planning to delete the existing unit tests? Because otherwise it begs the question: why even add the e2e tests?
It would be hard to know which unit tests would fail in the future with the new
If I create new e2e tests in the PR that adds the new Thus, by adding those tests here with the old |
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.
Some minor comments to improve tests and reduce diff.
Approving on the assumption that you can make CI pass.
); | ||
await expect(items.first()).toHaveAttribute('data-iui-focused', 'true'); | ||
const tags = await page | ||
.locator('#test-component-selected-live > span') |
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 locator is relying on an implementation detail which could change at any time?
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 was contemplating on whether to have selectors that depend on iTwinUI class names. That was why I used that span
selector.
Changed to directly target -select-tag
(057a5a0).
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.
The select-tag
is still coming from an internal class which can change at any time.
Right now we don't have a way to pass classes/attributes to the tag container or the tags (#894). This test could probably be rewritten to avoid relying on such implementation details (e.g. by only comparing the text inside the main container), but I'll leave it upto you if you want to rewrite it or add a TODO to wait until we allow customizing the tag container.
expectedLastTagTextContent: string | undefined; | ||
}) => { | ||
const tags = await page | ||
.locator('div[class$="-select-tag-container"] > span') |
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 locator is also relying on an implementation detail?
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.
Changed to directly target -select-tag
(057a5a0).
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.
Same as #2151 (comment), this is still relying on an implementation detail.
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.
Approving so that this isn't held up. Added some comments that I hope will help with the failing e2e tests on the CI.
Converting the PR to a draft to prevent it from merging before the other PRs in the PR stack are done. |
Changes
Pulled out of #2120 as PR 1 in the PR stack (PR stack order).
To make that PR easy to review, according to @mayank99's suggestion, I created this PR to only add new e2e tests that test the existing
useOverflow
logic. These tests will thus act as a baseline that the newuseOverflow
logic will also have to pass to make sure that there is no change in the resulting behavior.Some e2e tests (e.g.
MiddleTextTrucation
) seem to be failing only on GitHub (e.g. action run) but not locally. I guess this is a small testing environment specific issue that I am currently trying to fix. Thus, the PR is ready for review despite the failing tests.TODO:
Testing
Docs
N/A
After PR TODOs
await
ing theexpect
s in e2e tests (#2151 (comment))