${this.countryBasedLegalNotice()} ${this.preTextTemplate()}
@@ -724,12 +941,14 @@ class NoticeChoice extends StableSelectorMixin(LitElement) {
PHONE_CC: 'PHONE_CC',
PHONE_UC: 'PHONE_UC',
PHONE_UU: 'PHONE_UU',
+ EMAIL_NOTICE_ONLY: 'EMAIL_NOTICE_ONLY',
+ PHONE_NOTICE_ONLY: 'PHONE_NOTICE_ONLY',
+ NC_HIDDEN_PHONE_NONE: 'NC_HIDDEN_PHONE_NONE',
};
if (Object.prototype.hasOwnProperty.call(pwsFieldsMap, field)) {
field = pwsFieldsMap[field];
}
-
const init = {
bubbles: true,
detail: {
diff --git a/packages/web-components/src/components/notice-choice/services.ts b/packages/web-components/src/components/notice-choice/services.ts
index 96a3a957b8a..c2514492983 100644
--- a/packages/web-components/src/components/notice-choice/services.ts
+++ b/packages/web-components/src/components/notice-choice/services.ts
@@ -5,11 +5,17 @@
* LICENSE file in the root directory of this source tree.
*/
-export function loadContent(locale: string, onSuccess: any, onError: any) {
+export function loadContent(
+ locale: string,
+ env: string,
+ onSuccess: any,
+ onError: any
+) {
const script = document.createElement('script');
+ const environment = env === 'prod' ? '1.www.s81c.com' : '1.wwwstage.s81c.com';
script.async = false;
script.charset = 'utf-8';
- script.src = `https://www.ibm.com/common/translations/notice/v23/${locale.toLocaleLowerCase()}/ncContent_v23.js`; // URL for the third-party library being loaded.
+ script.src = `https://${environment}/common/translations/notice/v23/${locale.toLocaleLowerCase()}/ncContent_v23.js`; // URL for the third-party library being loaded.
document.body.appendChild(script);
script.onload = () => {
try {
diff --git a/packages/web-components/src/components/notice-choice/utils.ts b/packages/web-components/src/components/notice-choice/utils.ts
index b29e554ee8c..ad7e65ac585 100644
--- a/packages/web-components/src/components/notice-choice/utils.ts
+++ b/packages/web-components/src/components/notice-choice/utils.ts
@@ -49,6 +49,9 @@ export function pwsValueMap(value) {
PHONE_CC: 'CC',
PHONE_UC: 'UC',
PHONE_UU: 'UU',
+ EMAIL_NOTICE_ONLY: 'NOTICE_ONLY',
+ PHONE_NOTICE_ONLY: 'NOTICE_ONLY',
+ NC_HIDDEN_PHONE_NONE: 'N',
}[value] || null
);
}
diff --git a/packages/web-components/src/components/table-of-contents/__stories__/table-of-contents.stories.scss b/packages/web-components/src/components/table-of-contents/__stories__/table-of-contents.stories.scss
index 356781345dc..3d254ff34f0 100644
--- a/packages/web-components/src/components/table-of-contents/__stories__/table-of-contents.stories.scss
+++ b/packages/web-components/src/components/table-of-contents/__stories__/table-of-contents.stories.scss
@@ -1,5 +1,5 @@
//
-// Copyright IBM Corp. 2020, 2023
+// Copyright IBM Corp. 2020, 2024
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
@@ -9,7 +9,7 @@
@use '@carbon/ibmdotcom-styles/scss/globals/vars' as *;
.#{$c4d-prefix}-ce-demo--table-of-contents {
- padding: 0 $spacing-05;
+ padding: $spacing-05;
h3 {
padding-block: $spacing-07;
diff --git a/packages/web-components/tests/e2e-storybook/cypress/integration/button-group/button-group.e2e.js b/packages/web-components/tests/e2e-storybook/cypress/integration/button-group/button-group.e2e.js
new file mode 100644
index 00000000000..5a71e024cf2
--- /dev/null
+++ b/packages/web-components/tests/e2e-storybook/cypress/integration/button-group/button-group.e2e.js
@@ -0,0 +1,79 @@
+/**
+ * Copyright IBM Corp. 2021, 2024
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+/**
+ * Sets the correct defaultPath for Button Group
+ *
+ * @type {string}
+ * @private
+ */
+const _defaultPath = '/iframe.html?id=components-button-group--default';
+
+/* eslint-disable cypress/no-unnecessary-waiting */
+describe('c4d-button-group | default', () => {
+ beforeEach(() => {
+ cy.visit(`/${_defaultPath}`);
+ cy.injectAxe();
+ cy.viewport(1280, 780);
+ });
+
+ it('should check a11y', () => {
+ cy.checkAxeA11y();
+ });
+
+ it('should use given labels', () => {
+ cy.visit(
+ `/${_defaultPath}&knob-Button%201=Test%20Me%20Once&knob-Button%202=Test%20Me%20Twice`
+ );
+ cy.get('c4d-button-group-item')
+ .first()
+ .should('have.text', 'Test Me Once')
+ .next()
+ .should('have.text', 'Test Me Twice');
+
+ cy.takeSnapshots();
+ });
+
+ it('should use given labels with video cta-type mixed in', () => {
+ cy.visit(
+ `/${_defaultPath}&knob-Button%201=Test%20Me%20Once&knob-Button%202=Test%20Me%20Twice&knob-CTA%20type%20(cta-type)%202=video`
+ );
+ cy.get('c4d-button-group-item')
+ .first()
+ .should('have.text', 'Test Me Once')
+ .next()
+ .should('have.text', 'Test Me Twice');
+
+ cy.takeSnapshots();
+ });
+
+ it('should use video name for a video cta-type that has no label', () => {
+ cy.visit(
+ `/${_defaultPath}&knob-Button%201=Test%20Me%20Once&knob-Button%202=%20&knob-CTA%20type%20(cta-type)%202=video`
+ );
+ cy.get('c4d-button-group-item')
+ .first()
+ .should('have.text', 'Test Me Once')
+ .next()
+ .should('not.be.empty');
+
+ cy.takeSnapshots();
+ });
+
+ it('should not use video name for buttons that are not cta-type video', () => {
+ cy.visit(
+ `/${_defaultPath}&knob-Button%201=%20&knob-Button%202=%20&knob-CTA%20type%20(cta-type)%202=video`
+ );
+ cy.get('c4d-button-group-item')
+ .first()
+ .should('contain.text', '')
+ .next()
+ .should('not.be.empty');
+
+ cy.takeSnapshots();
+ });
+});
diff --git a/packages/web-components/tests/e2e-storybook/cypress/integration/feature-card/feature-card.e2e.js b/packages/web-components/tests/e2e-storybook/cypress/integration/feature-card/feature-card.e2e.js
index efe89a4b5c8..fdd56450121 100644
--- a/packages/web-components/tests/e2e-storybook/cypress/integration/feature-card/feature-card.e2e.js
+++ b/packages/web-components/tests/e2e-storybook/cypress/integration/feature-card/feature-card.e2e.js
@@ -62,10 +62,10 @@ describe('c4d-feature-card | medium', () => {
});
});
- it.skip('should have image on the left and content on the right side of the card', () => {
+ it('should have image on the left and content on the right side of the card', () => {
// image takes the left half
cy.get('c4d-image').then(($image) => {
- expect($image[0].getBoundingClientRect().left).to.equal(32);
+ expect($image[0].getBoundingClientRect().left).to.equal(33);
expect($image[0].getBoundingClientRect().right).to.equal(328);
});
@@ -75,7 +75,7 @@ describe('c4d-feature-card | medium', () => {
.find('.cds--card__wrapper')
.then(($content) => {
expect($content[0].getBoundingClientRect().left).to.equal(328);
- expect($content[0].getBoundingClientRect().right).to.equal(624);
+ expect($content[0].getBoundingClientRect().right).to.equal(623);
});
});
@@ -161,16 +161,17 @@ describe('c4d-feature-card | large', () => {
});
});
- it.skip('should have eyebrow, heading, and copy content', () => {
+ it('should have eyebrow, heading, and copy content', () => {
cy.get('c4d-card-eyebrow').invoke('text').should('not.be.empty');
cy.get('c4d-card-heading').invoke('text').should('not.be.empty');
cy.get('c4d-feature-card > p').invoke('text').should('not.be.empty');
});
+
- it.skip('should have image on the left and content on the right half of the card', () => {
+ it('should have image on the left and content on the right half of the card', () => {
// image takes the left half
cy.get('c4d-image').then(($image) => {
- expect($image[0].getBoundingClientRect().left).to.equal(16);
+ expect($image[0].getBoundingClientRect().left).to.equal(33);
expect($image[0].getBoundingClientRect().right).to.equal(529);
});
@@ -180,7 +181,7 @@ describe('c4d-feature-card | large', () => {
.find('.cds--card__wrapper')
.then(($content) => {
expect($content[0].getBoundingClientRect().left).to.equal(529);
- expect($content[0].getBoundingClientRect().right).to.equal(1042);
+ expect($content[0].getBoundingClientRect().right).to.equal(1025);
});
});