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

fix: hotfix onboarding notification e2e tests #24896

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ const onboardingCompleteWalletCreationWithOptOut = async (driver) => {
await Promise.all(
(
await driver.findClickableElements(
'.toggle-button.toggle-button--on:not([data-testid="basic-functionality-toggle"] .toggle-button)',
'.toggle-button.toggle-button--on:not([data-testid="basic-functionality-toggle"] .toggle-button):not([data-testid="profile-sync-toggle"] .toggle-button)',
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this change needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the driver actions above (a few lines above), we have already toggled the profile-sync button off, so we don't want to turn it back on.

NOTE - we will discuss with the team to better align with the global "Basic Functionality" toggle. (just some thoughts), but if the Basic Functionality is turned off, do we want to disable or hide our notification toggles & features. May be worth discussing with other teams on how this is solved.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, I see. I guess we could also just delete the line above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since our toggle opens a modal to warn you that you are turning off, I think the lines above are valid.

The snippet above, it toggles profile sync off, and then confirms turning off profile sync.

  await driver.clickElement(
    '[data-testid="profile-sync-toggle"] .toggle-button',
  );
  await driver.clickElement('[data-testid="submit-button"]');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do get it though, this is some crazy CSS selectors here. I'll see if we can filter or do something else instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, sorry, I missed that part about the modal. We can leave this as is for now and clean up later

)
).map((toggle) => toggle.click()),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ export default function PrivacySettings() {
setUseTransactionSimulations(isTransactionSimulationsEnabled);
dispatch(setPetnamesEnabled(turnOnPetnames));

if (!isProfileSyncingEnabled && participateInMetaMetrics) {
dispatch(performSignIn());
if (externalServicesOnboardingToggleState) {
if (!isProfileSyncingEnabled && participateInMetaMetrics) {
dispatch(performSignIn());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hotfixes to ensure we do not all these methods.

A separate PR/s will be out soon that will handle:

  1. Better UI states (our toggles will either need to be disabled or not visible if the External Services toggle is not enabled)
  2. Improved Logic and Controllers - ensure at a controller level that our MM services are not called when this switch is disabled.

}
}

if (ipfsURL && !ipfsError) {
Expand Down