-
Notifications
You must be signed in to change notification settings - Fork 153
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
Auct1037 rerequest email confirmation #5728
Auct1037 rerequest email confirmation #5728
Conversation
f0f85f1
to
dddd50b
Compare
expect(wrapper.text()).toContain("Link expired.") | ||
}) | ||
|
||
it.only("user seeing banner can click to re-trigger email confirmation message", async () => { |
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.
stray only
queryString: "?flash_message=expired_token", | ||
}) | ||
|
||
expect(wrapper.text()).toContain("Link expired.") |
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.
Can we assert upon the larger text that's now displayed. namely "Resend verification email"
|
||
expect(wrapper.text()).toContain("Link expired.") | ||
|
||
wrapper.find("button").first().prop("onClick")({} as any) |
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.
simulate("click")
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'll make these changes bc i prefer them too but the main reason i changed it is that the Enzyme team has effectively marked it for deprecation - essentially simulate('action', event)
is just syntactic sugar for prop('onAction')(event)
and so this api has created the misleading impression that key features like event bubbling will be simulated.
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.
Oh interesting - I wasn't aware of this! Thank you for clarifying – I read the issue and looks like there's a fair bit of back and forth on the semantics of shallow rendering vs. full DOM rendering with respect to the simulate API.
Regardless, I think, on principle, being consistent is more important than preparing for this API to be deprecated. A find+replace across the codebase when the API does indeed become deprecated should be pretty straightfoward.
.find("button") | ||
.first() | ||
.prop("onClick")({} as any) | ||
wrapper.find("button").first().prop("onClick")({} as any) |
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.
simulate("click")
.find("button") | ||
.first() | ||
.prop("onClick")({} as any) | ||
wrapper.find("button").first().prop("onClick")({} as any) |
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.
simulate("click")
|
||
expect(wrapper.text()).toContain("Link expired.") | ||
|
||
wrapper.find("button").first().prop("onClick")({} as any) |
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.
simulate("click")
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.
updated addressing all feedback- thank you!
|
||
expect(wrapper.text()).toContain("Link expired.") | ||
|
||
wrapper.find("button").first().prop("onClick")({} as any) |
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'll make these changes bc i prefer them too but the main reason i changed it is that the Enzyme team has effectively marked it for deprecation - essentially simulate('action', event)
is just syntactic sugar for prop('onAction')(event)
and so this api has created the misleading impression that key features like event bubbling will be simulated.
Jira Ticket AUCT-1037
This PR duplicates #5667 by changing the static 'link expired' message to one which includes a mutation for re-requesting email confirmation. It is mostly copy-pasted over with a new mutation and analytics schema value.
Notably this banner, when triggered by
?flash_message=expired_token
will appear whether you can request email confirmation (in ame.canRequestEmailConfirmation
sense) or not.Including the mobile view as an edge case:

TODO:
selectContent
function