commercetools / merchant-center-application-kit

Tools and components for developing Merchant Center Customizations 🛠
https://docs.commercetools.com/merchant-center-customizations
MIT License
67 stars 27 forks source link

fix(cypress): onBeforeLoad being called during login #3480

Closed tdeekens closed 6 months ago

tdeekens commented 6 months ago

Summary

The onBeforeLoad never seems to be called which this intends to fix.

Description

In the loginByOidc we call the onBeforeLoad like:

if (commandOptions.onBeforeLoad) {
  commandOptions.onBeforeLoad(win);
}

I noticed that we do not do this when logging in via the form. This causes issues internally when we use the general loginToMerchantCenter command which we often pass an onBeforeLoad to e.g. set local storage values to hide collapse the menu or hide certain models (like for rebranding).

We could either invoke the onBeforeLoad in the authCallback or when navigating to the initialRoute. The latter seems unexpected as you then only invoke the callback when another parameter is passed.

changeset-bot[bot] commented 6 months ago

🦋 Changeset detected

Latest commit: d8548e9615959f786619a9a11bc6c25f20d63d34

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages | Name | Type | | ----------------------------------------------------------------------------------- | ----- | | @commercetools-frontend/cypress | Patch | | @commercetools-applications/merchant-center-template-starter-typescript | Patch | | @commercetools-applications/merchant-center-template-starter | Patch | | @commercetools-applications/merchant-center-custom-view-template-starter-typescript | Patch | | @commercetools-applications/merchant-center-custom-view-template-starter | Patch | | @commercetools-backend/eslint-config-node | Patch | | @commercetools-backend/express | Patch | | @commercetools-backend/loggers | Patch | | @commercetools-frontend/actions-global | Patch | | @commercetools-frontend/application-components | Patch | | @commercetools-frontend/application-config | Patch | | @commercetools-frontend/application-shell-connectors | Patch | | @commercetools-frontend/application-shell | Patch | | @commercetools-frontend/assets | Patch | | @commercetools-frontend/babel-preset-mc-app | Patch | | @commercetools-frontend/browser-history | Patch | | @commercetools-frontend/codemod | Patch | | @commercetools-frontend/constants | Patch | | @commercetools-frontend/create-mc-app | Patch | | @commercetools-frontend/eslint-config-mc-app | Patch | | @commercetools-frontend/i18n | Patch | | @commercetools-frontend/jest-preset-mc-app | Patch | | @commercetools-frontend/jest-stylelint-runner | Patch | | @commercetools-frontend/l10n | Patch | | @commercetools-frontend/mc-dev-authentication | Patch | | @commercetools-frontend/mc-html-template | Patch | | @commercetools-frontend/mc-scripts | Patch | | @commercetools-frontend/notifications | Patch | | @commercetools-frontend/permissions | Patch | | @commercetools-frontend/react-notifications | Patch | | @commercetools-frontend/sdk | Patch | | @commercetools-frontend/sentry | Patch | | @commercetools-frontend/url-utils | Patch | | @commercetools-local/playground | Patch | | @commercetools-local/visual-testing-app | Patch | | @commercetools-website/components-playground | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
merchant-center-application-kit-components-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 4, 2024 9:22pm