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
MNTOR-3168 - Save email preferences changes on the client side #4518
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.
Just some forgotten changes that need a quick update. The only thing that is a potential blocker is the removed unit test - unless the functionality being tested was actually removed?
...app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/AlertAddressForm.tsx
Show resolved
Hide resolved
...app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/AlertAddressForm.tsx
Outdated
Show resolved
Hide resolved
@@ -275,40 +368,6 @@ it("preselects primary email alert option", () => { | |||
expect(primaryRadioButton).toHaveAttribute("aria-checked", "true"); | |||
}); | |||
|
|||
it("preselects affected email address option", () => { |
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.
Why is this test deleted? Any reason you can't set the subscriber
prop (rather than user.subscriber
) to have all_emails_to_primary: false
?
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.
Was no longer needed because it can't be undefined anymore (removed the nullish operator)
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.
OK, but to emphasise, code coverage is there as a tool to help find code you might have forgotten to test, but the thing we should actually be interested in is whether all functionality tested - and sometimes, that involves running the same lines of code multiple times.
const mockedSubscriber: SerializedSubscriber = { | ||
id: subscriberId, | ||
all_emails_to_primary: true, | ||
} as SerializedSubscriber; | ||
const subscriber: SubscriberRow = { |
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'm fairly sure if i read this in the future, I'm going to need to do a double-take to understand the difference between subscriber
and mockedSubscriber
. Maybe rename the later to mockedSerializedSubscriber
and the former to mockedSubscriber
?
(And as a reminder, you can easily rename all instances using F2 or right-click -> Rename Symbol.)
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.
fixed in 1c25eed
References:
Jira: MNTOR-3168
Description
Screenshot (if applicable)
Not applicable.
How to test
Checklist (Definition of Done)