Conversation
Emyrk
left a comment
There was a problem hiding this comment.
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.
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.
I think having several of them would be a fine outcome personally. This sort of "scoped custom expects" is what the Playwright documentation suggests.
|
|
||
| {lifetimeDays === "custom" && ( | ||
| <TextField | ||
| data-chromatic="ignore" |
There was a problem hiding this comment.
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,toHaveURLwill fail, because it matches the full URL.