-
Notifications
You must be signed in to change notification settings - Fork 881
test: fix url checks in e2e tests #12881
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
Conversation
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 toHaveURL
takes a string or a regex. I would guess the regex option would pass, and I guess the string option does not act like a regex match?? Kinda ridiculous imo the behavior is so different based on if you passed in a regex string or just a string.
Would be nice if we could add a linter or remove the toHaveURL
somehow to prevent misuse.
|
||
type PollingOptions = { timeout?: number; intervals?: number[] }; | ||
|
||
export const expectUrl = expect.extend({ |
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 is so interesting. Can we keep a set of extensions and just make it some generic "expectCoder" or something?
I just wonder if we'll build up a set of these.
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 think having several of them would be a fine outcome personally. This sort of "scoped custom expect
s" is what the Playwright documentation suggests.
@@ -116,6 +116,7 @@ export const CreateTokenForm: FC<CreateTokenFormProps> = ({ | |||
|
|||
{lifetimeDays === "custom" && ( | |||
<TextField | |||
data-chromatic="ignore" |
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.
Not sure what this is 🤔
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.
someone let a leaky date sneak in to chromatic again, so I'm muting it 😅
yeah, in the mean time I'm hoping people will mostly copy-paste from other tests that do the correct thing. :p |
Prevents flakes on pages like
WorkspacePage
, where query params are added after it has loaded. If they get added between polls,toHaveURL
will fail, because it matches the full URL.