Skip to content

Commit

Permalink
MWPW-147158: adds support for footer divider at the collection level (#…
Browse files Browse the repository at this point in the history
…2198)

* MWPW-147158: adds support for footer divider at the collection level

* Updatest unit-test files

* Update windows copy hash

* Update OSX copy hash

* Updates OSX hash again

* Removes console log

* Adds console logs for debbuging

* Removes console logs

* Adds console logs for debbuging again

* Removes console log

* Updates OSX hash

* Adds debuging message to test

* Update os-hash check logic

* trim() generated hash

* Changes the comparison logic for the hash

* Reverts last attempt

* new attempt to fix test

---------

Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com>
  • Loading branch information
cmiqueo and mokimo authored May 14, 2024
1 parent 3576061 commit 7a613d0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions libs/blocks/caas-config/caas-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ const BasicsPanel = ({ tagsData }) => {

const UiPanel = () => html`
<${Input} label="Show Card Borders" prop="setCardBorders" type="checkbox" />
<${Input} label="Show Footer Dividers" prop="showFooterDivider" type="checkbox" />
<${Input} label="Disable Card Banners" prop="disableBanners" type="checkbox" />
<${Input} label="Use Light Text" prop="useLightText" type="checkbox" />
<${Input} label="Use Overlay Links" prop="useOverlayLinks" type="checkbox" />
Expand Down
2 changes: 2 additions & 0 deletions libs/blocks/caas/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ export const getConfig = async (originalState, strs = {}) => {
},
detailsTextOption: state.detailsTextOption,
setCardBorders: state.setCardBorders,
showFooterDivider: state.showFooterDivider,
useOverlayLinks: state.useOverlayLinks,
collectionButtonStyle: state.collectionBtnStyle,
banner: {
Expand Down Expand Up @@ -793,6 +794,7 @@ export const defaultState = {
secondaryTags: [],
secondarySource: [],
setCardBorders: false,
showFooterDivider: false,
showBookmarksFilter: false,
showBookmarksOnCards: false,
showFilters: false,
Expand Down
12 changes: 5 additions & 7 deletions test/blocks/caas-config/caas-config.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,12 @@
// This does not affect the decoded hash value,
// so either of these are valid hashes for the same content

const windowsHash = '~~H4sIAAAAAAAAA3VVTY/bNhD9LzwrWafb9qDb2ruLGPBm3diLHoqgGJMjiTDFUcmhvUrR/15Q31Kcm/jecIbz5kP/ClBKsyYL5iv+E9DzHhyUXqR/fUsEWDA1a+k3ZAzKaPcFShSpEBPy6ECet2Xl0HtNVqQZGI/RQO0o1/IIee8vMG0oWHb1Dmw+WJ6IziW481aSPWCM1IaY4m/WTxgJTh24NvEtBZjsQ4E6L7hjjpoNPkgZH3TSRnO9wwsakf6eCDmksmbbu6icLsHVYkqPmY5Y43gJHvT3AbMM2qITqfj0y2r1Au9/asVFR6HlY13hqIdstRCpkAA+7Y53wccLwTOVG3Cq883w0IQTqfjbo8lEIhR9Id7B93pHoAY1lfZwMrgGa9H5EXaQ8eNpOKNVFWkbBb1erx9B0Qk/SirvZKFLdPABKn03ZinijYt2ZEu0XRXwXZqgUMVXdil10JhjBsacQJ6fxnAiERkCBze7mWnD6J4ug/cWWAdt1B5sLF/TQCWwlgO9IwmdKgYznuC5liIV5AZoFsdvGn1n0KGg61NZcT1olAfmppq/votEFAhqcFNohRuGrZqfx8S1XShhwOYBcuzL3Z/vMIproKbQ9EcMF6oIEagXcnizUS3xYrrImjqmsO6mZlC3S4bc4kIFubaNeg9Wl83HEAdyVGJq8mRjU41dNjJ/BLCsuYltb/BdTh3QFGQk3zweCyzxfrxoQGJBRqF7c6ZtBYc+GPZ7dPtGwN8S4RGcLJ41mr4CHiVZBa4eMxygAwUnsQc5CrMmp6bz4SfS+eemI25zr3auaySf+w6bYNuFzaF58Qw6EsfF2yQ3EuT4ERgfvPwBe8Qb4AspnelJbRoCMwgmjpLq77VEW8g9VaGaXWjxr2AVlQcoK6MnG7oxiKN5IMcz9Lmb5BnYv2iZQo//kEYbdg6hR3ch7fZERqSfVqvVgmheiSK9b/F26y8cN+AiXNcKooDr2YtviWDIfdtrP9+E0UZEU5cj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grdmzNtKzj0wbDfodslAX9bCI/gZPms0fQV8CjJKnDNmOEA7Sk4iT3IUZgVOTWdD1/S5ZmI0T3qs1ax7BOmF9U/p165zb3aueLJZd97E2xzZbNPucygA3FcySntkSDHj8D44OUP2CPeAF9I6VxPqpYIzCGYOGSqP9cSbYl3VId6dqDFv4JVVO2hqo2e7O5kEId2T45n6HM34zOwv9F1Cj3+Qxpt2DmEHt2ZtNsRGZF9Wi6XV0S6JYrsvsXb9+DKcQKvwnVNIkq4nLz4thAMhW+78Oc7MtqIaOoK5LijzzquEDFg16PDseHjwopPFvq4tBQyaOMP+M6vdbfPVFenheB41c8IStuie8lEeR+J2CWp5w4Uxy+KsRDB4za6jt6GoMHj6xmdgWar7Wnsqcl7GJjpxqYJHt3G5hSn57//AaZjTZUyCAAA';
const hash = copyTextArea.value.split('#')[1].trim();
let isCorrectHash = false;
const hash = copyTextArea.value.split('#')[1];
if (hash === windowsHash || hash === osxHash) {
isCorrectHash = true;
}
expect(isCorrectHash).to.be.true;
let osHash = navigator.platform.startsWith('Win') ? windowsHash : osxHash;
expect(hash).to.equal(osHash);
});

it('Clones an object', () => {
Expand Down
1 change: 1 addition & 0 deletions test/blocks/caas-config/expectedConfigs/defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const defaultConfig = {
},
detailsTextOption: 'default',
setCardBorders: false,
showFooterDivider: false,
useOverlayLinks: false,
banner: {
register: { description: 'Sign Up', url: '#registration' },
Expand Down
3 changes: 3 additions & 0 deletions test/blocks/caas/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ describe('getConfig', () => {
titleHeadingLevel: 'h3',
},
setCardBorders: false,
showFooterDivider: false,
useOverlayLinks: false,
additionalRequestParams: {},
banner: {
Expand Down Expand Up @@ -379,6 +380,7 @@ describe('getConfig', () => {
titleHeadingLevel: 'h3',
},
setCardBorders: false,
showFooterDivider: false,
useOverlayLinks: false,
additionalRequestParams: {},
banner: {
Expand Down Expand Up @@ -635,6 +637,7 @@ describe('getFloodgateCaasConfig', () => {
titleHeadingLevel: 'h3',
},
setCardBorders: false,
showFooterDivider: false,
useOverlayLinks: false,
additionalRequestParams: {},
banner: {
Expand Down

0 comments on commit 7a613d0

Please sign in to comment.