From b17a04deeb0f15366dbb237d8e69c04dadfd2421 Mon Sep 17 00:00:00 2001 From: 0xdev4coder Date: Mon, 26 Jun 2023 13:11:59 +0800 Subject: [PATCH] chore(e2e): privacy-policy (#671) * add Protection section test * add Titles check * add side menu clickable check * added test ids --- .../privacy-policy/privacy-policy.en-US.md | 28 ++++----- cypress/e2e/explore/privacy.spec.ts | 47 +++++++++++++++ cypress/fixture/privacy.config.ts | 60 +++++++++++++++++++ .../_components/TableOfContents.tsx | 1 + 4 files changed, 122 insertions(+), 14 deletions(-) create mode 100644 cypress/e2e/explore/privacy.spec.ts create mode 100644 cypress/fixture/privacy.config.ts diff --git a/content/privacy-policy/privacy-policy.en-US.md b/content/privacy-policy/privacy-policy.en-US.md index a590c205..ccc9b96e 100644 --- a/content/privacy-policy/privacy-policy.en-US.md +++ b/content/privacy-policy/privacy-policy.en-US.md @@ -4,7 +4,7 @@ subtitle: Privacy Policy description: Privacy Policy --- -

1. Introduction

+

1. Introduction

DEFICHAIN FOUNDATION LTD. (Company Number: 2068902) takes the privacy of your information seriously. This Privacy Policy applies to the defichain.com website (the “Website”) and governs data collection, processing and usage in compliance with the Data Protection Act, 2021 of the British Virgin Islands (“DPA”). @@ -18,7 +18,7 @@ This Privacy Policy has been compiled to better serve those who are concerned wi

-

2. Information collected from all visitors to our website or webapp

+

2. Information collected from all visitors to our website or webapp

@@ -33,13 +33,13 @@ This information is used by DEFICHAIN FOUNDATION LTD. for the operation of the s

-

3. When is information collected?

+

3. When is information collected?

We collect information from you when you subscribe to a newsletter, respond to a survey, fill out a form or enter information on our site.
-

4. Use of information and details

+

4. Use of information and details

@@ -54,7 +54,7 @@ We may use the information we collect from you when you sign up for our newslett

-

5. Security of your personal information

+

5. Security of your personal information

@@ -66,7 +66,7 @@ Aside from using regular Malware Scanning, your personal information is containe

-

6. Do you use Cookies?

+

6. Do you use Cookies?

@@ -92,19 +92,19 @@ If you disable cookies off, some features will be disabled and some of our servi

-

7. Third party disclosure

+

7. Third party disclosure

We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information unless we provide you with advance notice. This does not include website hosting partners and other parties who assist us in operating our website, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others’ rights, property, or safety. However, non-personally identifiable visitor information may be provided to other parties for marketing, advertising, or other uses.
- +
Our Website may contain links to other websites. This Privacy Policy only applies to this website so when you link to other websites you should read their own privacy policies.
-

9. Google

+

9. Google

@@ -151,19 +151,19 @@ Users are able to change their personal information:

-

10. “Do Not Track” signals

+

10. “Do Not Track” signals

We don’t honor “do not track signals” and do not track, plant cookies, or use advertising when a “Do Not Track” (DNT) browser mechanism is in place. We don’t honor them because we do not use that information.
-

11. Third party behavioural tracking

+

11. Third party behavioural tracking

It’s also important to note that we do not allow third party behavioral tracking.
-

12. Access to, updating, and non-use of your personal information

+

12. Access to, updating, and non-use of your personal information

@@ -176,13 +176,13 @@ You have the right to ask us not to collect, use, process, or disclose your Pers

-

13. Changes to this statement

+

13. Changes to this statement

Cake Pte Ltd will occasionally update this Privacy Policy to reflect customer feedback. DEFICHAIN FOUNDATION LTD. encourages you to periodically review this Privacy Policy to be informed of how DEFICHAIN FOUNDATION LTD. is protecting your information.
-

14. Contact information +

14. Contact information
DEFICHAIN FOUNDATION LTD. welcomes your comments regarding this Privacy Policy. If you believe that defichain.com has not adhered to this Privacy Policy, please contact us at support.
diff --git a/cypress/e2e/explore/privacy.spec.ts b/cypress/e2e/explore/privacy.spec.ts new file mode 100644 index 00000000..0dd994ce --- /dev/null +++ b/cypress/e2e/explore/privacy.spec.ts @@ -0,0 +1,47 @@ +import { viewports } from "../../fixture/main.config"; +import { titles } from "../../fixture/privacy.config"; + +viewports.forEach((viewport) => { + context(`/privacy-policy on ${viewport}`, () => { + beforeEach(() => { + cy.visit("/privacy-policy"); + cy.viewport(viewport); + }); + + it("should have Protection section visible", () => { + cy.checkElementVisibilityAndText( + "section-title-privacy-policy-protecting", + "PROTECTING YOUR PRIVACY" + ); + cy.checkElementVisibilityAndText( + "section-header-privacy-policy-protecting", + "Privacy Policy" + ); + cy.checkElementVisibilityAndText( + "section-desc-privacy-policy-protecting", + "Discover our commitment to protecting your privacy through our strict privacy policy" + ); + }); + + it("should have all the expected Titles visible expected text", () => { + titles.forEach((privacyTitle) => { + cy.findByTestId(privacyTitle.id) + .scrollIntoView() + .should("be.visible") + .and("include.text", privacyTitle.title); + }); + }); + + it("should be able to navigate on side menu", () => { + if (viewport === "macbook-16") { + titles.forEach((privacyTitle) => { + cy.findByTestId(privacyTitle.id).click(); + cy.checkElementVisibilityAndHref( + `link-${privacyTitle.id}`, + `#${privacyTitle.id}` + ); + }); + } + }); + }); +}); diff --git a/cypress/fixture/privacy.config.ts b/cypress/fixture/privacy.config.ts new file mode 100644 index 00000000..1480d654 --- /dev/null +++ b/cypress/fixture/privacy.config.ts @@ -0,0 +1,60 @@ +/* eslint-disable import/prefer-default-export */ +export const titles = [ + { + id: "introduction", + title: "1. Introduction", + }, + { + id: "information-collected", + title: + "2. Information collected from all visitors to our website or webapp", + }, + { + id: "when-information-collected", + title: "3. When is information collected?", + }, + { + id: "use-of-information", + title: "4. Use of information and details", + }, + { + id: "security", + title: "5. Security of your personal information", + }, + { + id: "cookies", + title: "6. Do you use Cookies?", + }, + { + id: "third-party", + title: "7. Third party disclosure", + }, + { + id: "links", + title: "8. Links to other websites", + }, + { + id: "google", + title: "9. Google", + }, + { + id: "do-not-track", + title: "10. “Do Not Track” signals", + }, + { + id: "third-party-tracking", + title: "11. Third party behavioural tracking", + }, + { + id: "access-personal-information", + title: "12. Access to, updating, and non-use of your personal information", + }, + { + id: "statement", + title: "13. Changes to this statement", + }, + { + id: "contact-information", + title: "14. Contact information", + }, +]; diff --git a/src/pages/privacy-policy/_components/TableOfContents.tsx b/src/pages/privacy-policy/_components/TableOfContents.tsx index e9842b0a..8b7bc36c 100644 --- a/src/pages/privacy-policy/_components/TableOfContents.tsx +++ b/src/pages/privacy-policy/_components/TableOfContents.tsx @@ -32,6 +32,7 @@ function Headings({ headings, activeId, parentReference }) { >