Skip to content
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

Merged
merged 5 commits into from May 13, 2024

Conversation

codemist
Copy link
Collaborator

References:

Jira: MNTOR-3168

Description

Screenshot (if applicable)

Not applicable.

How to test

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug.
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

@codemist codemist requested a review from Vinnl May 10, 2024 17:07
Copy link
Collaborator

@Vinnl Vinnl left a 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?

@@ -275,40 +368,6 @@ it("preselects primary email alert option", () => {
expect(primaryRadioButton).toHaveAttribute("aria-checked", "true");
});

it("preselects affected email address option", () => {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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)

Copy link
Collaborator

@Vinnl Vinnl May 14, 2024

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.

Comment on lines 53 to 57
const mockedSubscriber: SerializedSubscriber = {
id: subscriberId,
all_emails_to_primary: true,
} as SerializedSubscriber;
const subscriber: SubscriberRow = {
Copy link
Collaborator

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.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 1c25eed

@codemist codemist merged commit adae544 into main May 13, 2024
14 checks passed
@codemist codemist deleted the mntor-3168 branch May 13, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants