diff --git a/src/assets/img/icons/ccpa-icon.svg b/src/assets/img/icons/ccpa-icon.svg new file mode 100644 index 00000000..30eb3e08 --- /dev/null +++ b/src/assets/img/icons/ccpa-icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/common-components/site-header/menu-modal/menu-modal.spec.js b/src/common-components/site-header/menu-modal/menu-modal.spec.js index 49aa5d3c..5d461bc3 100644 --- a/src/common-components/site-header/menu-modal/menu-modal.spec.js +++ b/src/common-components/site-header/menu-modal/menu-modal.spec.js @@ -1,4 +1,4 @@ -import { shallowMount } from "@vue/test-utils"; +import { mount, shallowMount } from "@vue/test-utils"; import menuModal from "./menu-modal"; describe("menu-modal.vue", () => { @@ -32,12 +32,28 @@ describe("menu-modal.vue", () => { expect(wrapper.html()).toContain("Terms of use"); }); - it("Should return Privacy policy text link text", async () => { + it('Should return "Your privacy choices" text link text', async () => { // Act - const wrapper = shallowMount(menuModal); + const wrapper = mount(menuModal); // Expect - expect(wrapper.html()).toContain("Privacy policy"); + expect(wrapper.html()).toContain("Your privacy choices"); + }); + + test('Icon for link to "Privacy Policies" page is displayed with the correct alternate text', () => { + // NOTE: We need a way to target a specific component so we can be sure that + // an icon is coming from a specific component. + // That requires an additional prop in the component. Will hold off on adding the prop + // until there is more clarity on how we handle shared components. + // For now the test is below is the best we can do. + + // Arrange + const wrapper = mount(menuModal); + + // Expect + const icon = wrapper.find('[data-id="ccpa-icon"]'); + expect(icon.isVisible()).toBe(true); + expect(icon.attributes('alt')).toBe('Your privacy choices'); }); it("Should returnDo not sell my information text link text", async () => { diff --git a/src/common-components/site-header/menu-modal/menu-modal.vue b/src/common-components/site-header/menu-modal/menu-modal.vue index 82d248e0..e2c33dee 100644 --- a/src/common-components/site-header/menu-modal/menu-modal.vue +++ b/src/common-components/site-header/menu-modal/menu-modal.vue @@ -28,7 +28,21 @@