diff --git a/src/components/Personalization/createFetchDataHandler.js b/src/components/Personalization/createFetchDataHandler.js index 0c844e9ed..63ee60491 100644 --- a/src/components/Personalization/createFetchDataHandler.js +++ b/src/components/Personalization/createFetchDataHandler.js @@ -26,6 +26,8 @@ export default ({ return ({ cacheUpdate, personalizationDetails, event, onResponse }) => { if (personalizationDetails.isRenderDecisions()) { hideContainers(prehidingStyle); + } else { + showContainers(); } mergeQuery(event, personalizationDetails.createQueryDetails()); diff --git a/src/components/Personalization/handlers/createProcessPropositions.js b/src/components/Personalization/handlers/createProcessPropositions.js index d58b494a6..15aeabcdc 100644 --- a/src/components/Personalization/handlers/createProcessPropositions.js +++ b/src/components/Personalization/handlers/createProcessPropositions.js @@ -23,8 +23,8 @@ export default ({ schemaProcessors, logger }) => { .catch(error => { if (logger.enabled) { const { message, stack } = error; - const errorMessage = `Failed to execute action ${item.toString()}. ${message} ${stack}`; - logger.error(errorMessage); + const warning = `Failed to execute action ${item.toString()}. ${message} ${stack}`; + logger.warn(warning); } return false; }); diff --git a/test/functional/specs/Personalization/C14299419.js b/test/functional/specs/Personalization/C14299419.js new file mode 100644 index 000000000..d77aaefad --- /dev/null +++ b/test/functional/specs/Personalization/C14299419.js @@ -0,0 +1,47 @@ +/* +Copyright 2023 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ +import { t, Selector } from "testcafe"; +import createFixture from "../../helpers/createFixture"; +import { + compose, + orgMainConfigMain, + debugEnabled +} from "../../helpers/constants/configParts"; +import { TEST_PAGE as TEST_PAGE_URL } from "../../helpers/constants/url"; +import createAlloyProxy from "../../helpers/createAlloyProxy"; +import addHtmlToHeader from "../../helpers/dom/addHtmlToHeader"; + +const config = compose(orgMainConfigMain, debugEnabled); + +createFixture({ + title: + "C14299419: Prehiding style is removed when no personalization payload is returned", + url: `${TEST_PAGE_URL}?test=C14299419` +}); + +test.meta({ + ID: "C14299419", + SEVERITY: "P0", + TEST_RUN: "Regression" +}); + +test("Test C14299419: Prehiding style is removed when no personalization payload is returned", async () => { + await addHtmlToHeader( + ` { + await addHtmlToHeader( + ` { + const logger = await createConsoleLogger(); + + // remove the heading so there is an error when trying to apply the personalization which is attached to the h1 + await t.eval(() => { + window.document.body.children[0].remove(); + }); + await addHtmlToBody(`