@newskit-render/core 0.0.0-d55b7d88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ci/trigger-circleci-workflow.sh +37 -0
- package/.eslintignore +23 -0
- package/.eslintrc +74 -0
- package/.prettierignore +19 -0
- package/.prettierrc +7 -0
- package/CHANGELOG.md +7638 -0
- package/Dockerfile +14 -0
- package/Dockerfile.withNewRelic +15 -0
- package/README.md +274 -0
- package/__tests__/pages/__snapshots__/brightcove.test.tsx.snap +20 -0
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +1195 -0
- package/__tests__/pages/brightcove.test.tsx +34 -0
- package/__tests__/pages/empty.test.tsx +10 -0
- package/__tests__/pages/home.test.tsx +16 -0
- package/app-context/InstrumentationContextProvider.tsx +36 -0
- package/assets/fontFamily.ts +416 -0
- package/assets/fonts/Graphik-Black-App.ttf +0 -0
- package/assets/fonts/Graphik-BlackItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Bold-App.ttf +0 -0
- package/assets/fonts/Graphik-BoldItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Extralight-App.ttf +0 -0
- package/assets/fonts/Graphik-ExtralightItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Light-App.ttf +0 -0
- package/assets/fonts/Graphik-LightItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Medium-App.ttf +0 -0
- package/assets/fonts/Graphik-Medium-Web.woff2 +0 -0
- package/assets/fonts/Graphik-MediumItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Regular-App.ttf +0 -0
- package/assets/fonts/Graphik-Regular-Web.woff2 +0 -0
- package/assets/fonts/Graphik-RegularItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Semibold-App.ttf +0 -0
- package/assets/fonts/Graphik-Semibold-Web.woff2 +0 -0
- package/assets/fonts/Graphik-SemiboldItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Super-App.ttf +0 -0
- package/assets/fonts/Graphik-SuperItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Thin-App.ttf +0 -0
- package/assets/fonts/Graphik-ThinItalic-App.ttf +0 -0
- package/assets/fonts/Montserrat-Black.ttf +0 -0
- package/assets/fonts/Montserrat-BlackItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Bold.ttf +0 -0
- package/assets/fonts/Montserrat-BoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBold.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLight.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Italic.ttf +0 -0
- package/assets/fonts/Montserrat-Light.ttf +0 -0
- package/assets/fonts/Montserrat-LightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/assets/fonts/Montserrat-MediumItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Thin.ttf +0 -0
- package/assets/fonts/Montserrat-ThinItalic.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Black-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-BlackItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Bold-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Bold-Web.woff2 +0 -0
- package/assets/fonts/PublicoHeadline-BoldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Extrabold-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-ExtraboldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Italic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Light-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-LightItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Medium-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-MediumItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Roman-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Roman-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Bold-App.ttf +0 -0
- package/assets/fonts/PublicoText-BoldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoText-Italic-App.ttf +0 -0
- package/assets/fonts/PublicoText-Italic-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Roman-App.ttf +0 -0
- package/assets/fonts/PublicoText-Roman-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Semibold-App.ttf +0 -0
- package/assets/fonts/PublicoText-SemiboldItalic-App.ttf +0 -0
- package/assets/fonts/Roboto-Bold.ttf +0 -0
- package/assets/fonts/Roboto-Light.ttf +0 -0
- package/assets/fonts/Roboto-Medium.ttf +0 -0
- package/assets/fonts/Roboto-Regular.ttf +0 -0
- package/assets/fonts/TheSun-Bold.ttf +0 -0
- package/assets/fonts/TheSun-BoldItalic.ttf +0 -0
- package/assets/fonts/TheSun-HeavyCondensed.ttf +0 -0
- package/assets/fonts/TheSun-HeavyNarrow.ttf +0 -0
- package/assets/fonts/TheSun-Italic.ttf +0 -0
- package/assets/fonts/TheSun-Medium.ttf +0 -0
- package/assets/fonts/TheSun-MediumItalic.ttf +0 -0
- package/assets/fonts/TheSun-Regular.ttf +0 -0
- package/assets/fonts/TimesDigital-Bold.ttf +0 -0
- package/assets/fonts/TimesDigital-BoldItalic.ttf +0 -0
- package/assets/fonts/TimesDigital-BoldSC.ttf +0 -0
- package/assets/fonts/TimesDigital-Italic.ttf +0 -0
- package/assets/fonts/TimesDigital-Regular.ttf +0 -0
- package/assets/fonts/TimesDigital-RegularSC.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Bold.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-BoldItalic.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-BoldSC.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Italic.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Regular.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-RegularSC.ttf +0 -0
- package/assets/fonts/TimesModern-Regular.otf +0 -0
- package/assets/fonts/attribuitions.mdx +35 -0
- package/assets/fonts/bitter-medium.woff +0 -0
- package/assets/fonts/bitter-medium.woff2 +0 -0
- package/assets/fonts/bitter-mediumitalic.woff +0 -0
- package/assets/fonts/bitter-mediumitalic.woff2 +0 -0
- package/assets/fonts/bitter-regular.woff +0 -0
- package/assets/fonts/bitter-regular.woff2 +0 -0
- package/assets/fonts/bitter-semibold.woff +0 -0
- package/assets/fonts/bitter-semibold.woff2 +0 -0
- package/assets/fonts/dmmono-medium.woff +0 -0
- package/assets/fonts/dmmono-medium.woff2 +0 -0
- package/assets/fonts/dmsans-bold-webfont.woff +0 -0
- package/assets/fonts/dmsans-bold-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-bolditalic-webfont.woff +0 -0
- package/assets/fonts/dmsans-bolditalic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-italic-webfont.woff +0 -0
- package/assets/fonts/dmsans-italic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-medium-webfont.woff +0 -0
- package/assets/fonts/dmsans-medium-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-mediumitalic-webfont.woff +0 -0
- package/assets/fonts/dmsans-mediumitalic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-regular-webfont.woff +0 -0
- package/assets/fonts/dmsans-regular-webfont.woff2 +0 -0
- package/assets/fonts/notosans-bold-webfont.woff +0 -0
- package/assets/fonts/notosans-bold-webfont.woff2 +0 -0
- package/assets/fonts/notosans-italic-webfont.woff +0 -0
- package/assets/fonts/notosans-italic-webfont.woff2 +0 -0
- package/assets/fonts/notosans-medium-webfont.woff +0 -0
- package/assets/fonts/notosans-medium-webfont.woff2 +0 -0
- package/assets/fonts/notosans-regular-webfont.woff +0 -0
- package/assets/fonts/notosans-regular-webfont.woff2 +0 -0
- package/assets/fonts/poppins-bold-webfont.woff +0 -0
- package/assets/fonts/poppins-bold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-bolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-bolditalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-extrabold-webfont.woff +0 -0
- package/assets/fonts/poppins-extrabold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-extrabolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-extrabolditalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-italic-webfont.woff +0 -0
- package/assets/fonts/poppins-italic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-light-webfont.woff +0 -0
- package/assets/fonts/poppins-light-webfont.woff2 +0 -0
- package/assets/fonts/poppins-lightitalic-webfont.woff +0 -0
- package/assets/fonts/poppins-lightitalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-medium-webfont.woff +0 -0
- package/assets/fonts/poppins-medium-webfont.woff2 +0 -0
- package/assets/fonts/poppins-mediumitalic-webfont.woff +0 -0
- package/assets/fonts/poppins-mediumitalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-regular-webfont.woff +0 -0
- package/assets/fonts/poppins-regular-webfont.woff2 +0 -0
- package/assets/fonts/poppins-semibold-webfont.woff +0 -0
- package/assets/fonts/poppins-semibold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-semibolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-semibolditalic-webfont.woff2 +0 -0
- package/assets/fonts/source-serif-pro-600.woff +0 -0
- package/assets/fonts/source-serif-pro-600.woff2 +0 -0
- package/assets/fonts/source-serif-pro-600italic.woff +0 -0
- package/assets/fonts/source-serif-pro-600italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-700.woff +0 -0
- package/assets/fonts/source-serif-pro-700.woff2 +0 -0
- package/assets/fonts/source-serif-pro-700italic.woff +0 -0
- package/assets/fonts/source-serif-pro-700italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-italic.woff +0 -0
- package/assets/fonts/source-serif-pro-italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-regular.woff +0 -0
- package/assets/fonts/source-serif-pro-regular.woff2 +0 -0
- package/components/AccountDropdown/AccountDropdown.tsx +65 -0
- package/components/AccountDropdown/__tests__/AcountDropdown.test.tsx +83 -0
- package/components/AccountDropdown/accounts.ts +47 -0
- package/components/AccountDropdown/index.tsx +2 -0
- package/components/AccountDropdown/utils.ts +21 -0
- package/components/ErrorPage/ErrorPage.tsx +135 -0
- package/components/ad/index.tsx +35 -0
- package/components/article/Highlights.tsx +77 -0
- package/components/article/MetaBox.tsx +50 -0
- package/components/article/RelatedArticles.tsx +53 -0
- package/components/article/RelatedTopics.tsx +59 -0
- package/components/article/ShareBarComponent.tsx +53 -0
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +1568 -0
- package/components/article/__tests__/index.test.tsx +171 -0
- package/components/article/__tests__/mocks.ts +105 -0
- package/components/article/index.tsx +320 -0
- package/components/common/BackToHomepage.tsx +37 -0
- package/components/common/NavLink.tsx +26 -0
- package/components/common/NewskitLogo.tsx +52 -0
- package/components/common/NewskitLogoShort.tsx +48 -0
- package/components/common/SectionTitleBar.tsx +57 -0
- package/components/common/ShareButton.tsx +18 -0
- package/components/common/ViewMoreButton.tsx +20 -0
- package/components/common/iconNavLink/IconNavLink.tsx +70 -0
- package/components/common/iconNavLink/__tests__/IconNavLink.test.tsx +35 -0
- package/components/common/iconNavLink/index.ts +3 -0
- package/components/common/iconNavLink/types.ts +24 -0
- package/components/common/icons/IconAccount.tsx +13 -0
- package/components/common/icons/IconFilledTwitter.tsx +14 -0
- package/components/common/icons/StyledIconFilledChevronRight.tsx +12 -0
- package/components/footer/__snapshots__/index.test.tsx.snap +192 -0
- package/components/footer/index.test.tsx +13 -0
- package/components/footer/index.tsx +151 -0
- package/components/header/banner-messages.ts +39 -0
- package/components/header/index.tsx +52 -0
- package/components/header/navigation-links.ts +20 -0
- package/components/layout/Gutter.tsx +11 -0
- package/components/layout/LayoutTemplate.tsx +26 -0
- package/components/layout/MainGrid.tsx +66 -0
- package/components/layout/index.tsx +3 -0
- package/components/layout/layoutTypes.ts +13 -0
- package/components/section/ArticleSlice.tsx +35 -0
- package/components/section/CollectionBlock.tsx +54 -0
- package/components/section/SectionContext.tsx +9 -0
- package/components/section/__tests__/ArticleSlice.test.tsx +128 -0
- package/components/section/__tests__/CollectionBlock.test.tsx +83 -0
- package/components/section/__tests__/pageBlock.test.tsx +24 -0
- package/components/section/__tests__/sectionUtils.test.ts +94 -0
- package/components/section/index.tsx +39 -0
- package/components/section/layouts/Block.tsx +79 -0
- package/components/section/layouts/FallBack.tsx +24 -0
- package/components/section/layouts/Lead.tsx +43 -0
- package/components/section/layouts/Rows.tsx +82 -0
- package/components/section/layouts/SectionTitle.tsx +57 -0
- package/components/section/layouts/__tests__/Lead.test.tsx +37 -0
- package/components/section/layouts/__tests__/Rows.test.tsx +40 -0
- package/components/section/layouts/__tests__/SectionTitle.test.tsx +37 -0
- package/components/section/layouts/__tests__/__snapshots__/Lead.test.tsx.snap +180 -0
- package/components/section/layouts/__tests__/__snapshots__/SectionTitle.test.tsx.snap +354 -0
- package/components/section/layouts/gridUtils.ts +21 -0
- package/components/section/layouts/index.tsx +4 -0
- package/components/section/layouts/types.ts +13 -0
- package/components/section/pageBlock.tsx +23 -0
- package/components/section/sectionUtils.ts +61 -0
- package/components/teaser/index.test.tsx +50 -0
- package/components/teaser/index.tsx +64 -0
- package/components/teaser/teaserVariants.ts +33 -0
- package/components/teaser/variant-types.ts +49 -0
- package/components/teaser/variants/featureVariant.ts +42 -0
- package/components/teaser/variants/horizontal.ts +14 -0
- package/components/teaser/variants/titleTeaserVariant.ts +32 -0
- package/components/teaser/variants/titleVertical.ts +24 -0
- package/components/utils/index.test.ts +12 -0
- package/components/utils/index.ts +6 -0
- package/config/__tests__/index.test.ts +54 -0
- package/config/environment.ts +80 -0
- package/config/index.ts +2 -0
- package/config/multiTenancy.ts +11 -0
- package/constants/index.ts +2 -0
- package/context/app-context/AppContext.test.tsx +56 -0
- package/context/app-context/holidayStopListContextOverrides.ts +18 -0
- package/context/app-context/index.tsx +34 -0
- package/context/app-context/paymentMethodContext.tsx +70 -0
- package/context/index.tsx +2 -0
- package/context/multi-tenancy/MultiTenancy.test.tsx +48 -0
- package/context/multi-tenancy/index.tsx +32 -0
- package/css/index.ts +15 -0
- package/cypress/axe/terminal-log.js +19 -0
- package/cypress/config/visual.config.ts +11 -0
- package/cypress/config/visual.skip.config.ts +10 -0
- package/cypress/e2e/account/accessibility.cy.js +88 -0
- package/cypress/e2e/account/banners.cy.js +169 -0
- package/cypress/e2e/account/cancellation.cy.js +219 -0
- package/cypress/e2e/account/holiday-stops.cy.js +109 -0
- package/cypress/e2e/account/main-api.cy.js +102 -0
- package/cypress/e2e/account/newsletters-and-alerts.cy.js +149 -0
- package/cypress/e2e/account/newsletters-page.cy.js +69 -0
- package/cypress/e2e/account/payment-page.cy.js +98 -0
- package/cypress/e2e/account/personal-details.cy.js +1161 -0
- package/cypress/e2e/account/subscription-and-billing.cy.js +434 -0
- package/cypress/e2e/checkout/account-creation.cy.js +8 -0
- package/cypress/e2e/checkout/payment-details.cy.js +19 -0
- package/cypress/e2e/core/home-page.cy.js +6 -0
- package/cypress/e2e/help-hub/accessibility.cy.js +35 -0
- package/cypress/e2e/help-hub/article-page.cy.js +115 -0
- package/cypress/e2e/help-hub/landing-page.cy.js +94 -0
- package/cypress/e2e/help-hub/result-page.cy.js +117 -0
- package/cypress/fixtures/empty.html +10 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/fixtures/holiday-stops.json +40 -0
- package/cypress/fixtures/paymentFailure.js +24 -0
- package/cypress/fixtures/testDates.js +26 -0
- package/cypress/support/commands.js +125 -0
- package/cypress/support/consentValues.js +5839 -0
- package/cypress/support/e2e.js +22 -0
- package/cypress/support/users.js +58 -0
- package/cypress/visual/account/print-visual-regression.cy.js +9 -0
- package/cypress/visual/account/visual-regression.cy.js +40 -0
- package/cypress/visual/empty/empty.cy.js +5 -0
- package/cypress.config.ts +38 -0
- package/helpers/__tests__/getUser.test.ts +45 -0
- package/helpers/__tests__/logger.test.ts +62 -0
- package/helpers/__tests__/useThemeDropdownObject.test.ts +49 -0
- package/helpers/a11y.ts +7 -0
- package/helpers/addCacheHeaders.ts +8 -0
- package/helpers/getUser.ts +37 -0
- package/helpers/getYear.ts +1 -0
- package/helpers/global-types.ts +186 -0
- package/helpers/logger/getWinstonLogger.ts +19 -0
- package/helpers/logger/index.ts +20 -0
- package/helpers/logger/replaceConsoleWithLogger.ts +14 -0
- package/helpers/mocks/articleMock.ts +50 -0
- package/helpers/mocks/getPageMock.ts +369 -0
- package/helpers/mocks/getRadioPostMock.ts +71 -0
- package/helpers/mocks/getRadioPostsMock.ts +26 -0
- package/helpers/mocks/getRecommendationsMock.ts +20 -0
- package/helpers/mocks/index.ts +7 -0
- package/helpers/multiTenancy.ts +19 -0
- package/helpers/setupTests.ts +5 -0
- package/helpers/test-utils.tsx +33 -0
- package/helpers/useThemeDropdownObject.tsx +73 -0
- package/infrastructure/.circleci/config.yml +1187 -0
- package/infrastructure/INFRASTRUCTURE.md +142 -0
- package/infrastructure/build_and_deploy.png +0 -0
- package/infrastructure/helm/Chart.yaml +21 -0
- package/infrastructure/helm/templates/_helpers.tpl +87 -0
- package/infrastructure/helm/templates/deployment.yaml +45 -0
- package/infrastructure/helm/templates/horizontalpodautoscaler.yaml +21 -0
- package/infrastructure/helm/templates/ingress.yaml +31 -0
- package/infrastructure/helm/templates/networkpolicy.yaml +26 -0
- package/infrastructure/helm/templates/secret.yaml +12 -0
- package/infrastructure/helm/templates/service.yaml +15 -0
- package/infrastructure/helm/values-dev.yaml +39 -0
- package/infrastructure/helm/values-local.yaml +30 -0
- package/infrastructure/helm/values-pr.yaml +40 -0
- package/infrastructure/helm/values-prod.yaml +39 -0
- package/infrastructure/helm/values-staging.yaml +39 -0
- package/infrastructure/helm/values.yaml +44 -0
- package/infrastructure/pull_request.png +0 -0
- package/infrastructure/release-documentation-cli.config.json +18 -0
- package/infrastructure/remove_pr.png +0 -0
- package/infrastructure/terraform-ecr/dev.tfvars +3 -0
- package/infrastructure/terraform-ecr/ecr.tf +69 -0
- package/infrastructure/terraform-ecr/main.tf +3 -0
- package/infrastructure/terraform-ecr/variables.tf +19 -0
- package/infrastructure/terraform-ecr/versions.tf +12 -0
- package/infrastructure/terraform-newrelic/alerts.tf +290 -0
- package/infrastructure/terraform-newrelic/dashboards.tf +347 -0
- package/infrastructure/terraform-newrelic/dev.tfvars +3 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-dev.js +53 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-prod.js +54 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-stage.js +54 -0
- package/infrastructure/terraform-newrelic/main.tf +11 -0
- package/infrastructure/terraform-newrelic/monitors.tf +11 -0
- package/infrastructure/terraform-newrelic/prod.tfvars +3 -0
- package/infrastructure/terraform-newrelic/staging.tfvars +3 -0
- package/infrastructure/terraform-newrelic/variables.tf +33 -0
- package/infrastructure/terraform-newrelic/versions.tf +18 -0
- package/jest.config.js +40 -0
- package/jest.config.pact.js +18 -0
- package/newrelic.js +86 -0
- package/next-env.d.ts +5 -0
- package/next.config.js +95 -0
- package/package.json +127 -0
- package/pages/_app.tsx +117 -0
- package/pages/_document.tsx +112 -0
- package/pages/_error.tsx +68 -0
- package/pages/account/add/[field].tsx +34 -0
- package/pages/account/cancellation/index.tsx +22 -0
- package/pages/account/delete/confirm/index.tsx +16 -0
- package/pages/account/delete/error/index.tsx +16 -0
- package/pages/account/delete/index.tsx +16 -0
- package/pages/account/delete/success/index.tsx +16 -0
- package/pages/account/dream-team/index.tsx +19 -0
- package/pages/account/edit/[field].tsx +45 -0
- package/pages/account/family/index.tsx +19 -0
- package/pages/account/holiday-stop/index.tsx +19 -0
- package/pages/account/holiday-stop/previous-holiday-stops.tsx +19 -0
- package/pages/account/holiday-stop/upcoming-holiday-stops.tsx +19 -0
- package/pages/account/index.tsx +33 -0
- package/pages/account/newsletters/index.tsx +19 -0
- package/pages/account/newsletters-and-alerts/index.tsx +24 -0
- package/pages/account/payment/[paymentMethod].tsx +37 -0
- package/pages/account/payment/index.tsx +23 -0
- package/pages/account/payment-methods/index.tsx +21 -0
- package/pages/account/subscription-and-billing/index.tsx +29 -0
- package/pages/api/account/get-session/index.ts +33 -0
- package/pages/api/account/invoice/index.ts +35 -0
- package/pages/api/account/mutate/index.ts +8 -0
- package/pages/api/account/query/index.ts +7 -0
- package/pages/api/auth/[...nextauth].ts +11 -0
- package/pages/api/competitions-sitemap.ts +19 -0
- package/pages/api/feed.ts +23 -0
- package/pages/api/health-check.ts +7 -0
- package/pages/api/news-sitemap.ts +18 -0
- package/pages/api/pages-sitemap.ts +27 -0
- package/pages/api/robots.ts +19 -0
- package/pages/api/sitemap.ts +24 -0
- package/pages/checkout/account-creation/index.tsx +13 -0
- package/pages/checkout/payment-details/index.tsx +10 -0
- package/pages/empty.tsx +6 -0
- package/pages/help-hub/article/[title]/index.tsx +25 -0
- package/pages/help-hub/error.tsx +23 -0
- package/pages/help-hub/index.tsx +51 -0
- package/pages/help-hub/results.tsx +25 -0
- package/pages/index.tsx +19 -0
- package/pages/player/brightcove.tsx +19 -0
- package/pages/rss/create/index.tsx +18 -0
- package/pages/rss/feed/[feedId]/index.tsx +21 -0
- package/pages/rss/index.tsx +18 -0
- package/public/ads.min.js +8175 -0
- package/public/assets/display-base-header.svg +25 -0
- package/public/assets/display-personalDetails-header-sun.svg +55 -0
- package/public/assets/display-personalDetails-header-times.svg +90 -0
- package/public/assets/display-personalDetails-header-vr.svg +46 -0
- package/public/assets/dream-team.svg +10 -0
- package/public/assets/navigationPrimary-brandMark-sun.svg +9 -0
- package/public/assets/navigationPrimary-brandMark-times.svg +18 -0
- package/public/assets/navigationPrimary-brandMark-vr.svg +10 -0
- package/public/assets/newsletters/bestoftimes-101.png +0 -0
- package/public/assets/newsletters/books-115.png +0 -0
- package/public/assets/newsletters/environment-140.png +0 -0
- package/public/assets/newsletters/fashion-108.png +0 -0
- package/public/assets/newsletters/food-106.png +0 -0
- package/public/assets/newsletters/football-111.png +0 -0
- package/public/assets/newsletters/ireland-152.png +0 -0
- package/public/assets/newsletters/law-121.png +0 -0
- package/public/assets/newsletters/money-107.png +0 -0
- package/public/assets/newsletters/moneymentor-150.png +0 -0
- package/public/assets/newsletters/placeholder.png +0 -0
- package/public/assets/newsletters/politics-119.png +0 -0
- package/public/assets/newsletters/property-113.png +0 -0
- package/public/assets/newsletters/puzzles-125.png +0 -0
- package/public/assets/newsletters/scotland-134.png +0 -0
- package/public/assets/newsletters/theatre-127.png +0 -0
- package/public/assets/newsletters/travel-149.png +0 -0
- package/public/assets/newsletters/tv-133.png +0 -0
- package/public/assets/newsletters/us-153.png +0 -0
- package/public/assets/no-subscription.svg +15 -0
- package/public/assets/pending-activation.svg +16 -0
- package/public/assets/personal-details-header.svg +91 -0
- package/public/assets/plchldr150x100.png +0 -0
- package/public/assets/previous-subscription.svg +15 -0
- package/public/assets/primary-navigation-logo-white.svg +6 -0
- package/public/assets/primary-navigation-logo.svg +6 -0
- package/public/assets/tls-logo-white.svg +3 -0
- package/public/favicon.ico +0 -0
- package/public/icon.png +0 -0
- package/public/prebid.min.js +1 -0
- package/queries/getPage.ts +100 -0
- package/queries/getRadioPost.ts +61 -0
- package/queries/getRadioPosts.ts +16 -0
- package/queries/getUserSubscription.ts +9 -0
- package/queries/index.ts +3 -0
- package/scripts/k8s-local.sh +137 -0
- package/scripts/nr-exports.sh +7 -0
- package/temp/_app.tsx +15 -0
- package/temp/_document.tsx +61 -0
- package/temp/app-context-test.tsx +51 -0
- package/temp/app-context.tsx +25 -0
- package/temp/config-index.ts +1 -0
- package/temp/context-index.tsx +1 -0
- package/temp/header.tsx +45 -0
- package/temp/next.config.js +56 -0
- package/tsconfig.json +51 -0
- package/tsconfig.test.json +6 -0
- package/validation/index.tsx +24 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { getTestDates } from '../../fixtures/testDates'
|
|
2
|
+
|
|
3
|
+
describe('Book a Holiday Stop', () => {
|
|
4
|
+
beforeEach(() => {
|
|
5
|
+
cy.GetTnlAcsSession('tnl')
|
|
6
|
+
cy.mockConsentAndVisit('/account/holiday-stop')
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
it('should display book a Holiday Stop page', () => {
|
|
10
|
+
cy.get('a[href="/account/subscription-and-billing"]').should('be.visible')
|
|
11
|
+
cy.contains('[data-testid="introduction-title"]', 'Book a Holiday Stop')
|
|
12
|
+
cy.contains('Add a Holiday Stop')
|
|
13
|
+
})
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
describe('Add a Holiday Stop', () => {
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
cy.GetTnlAcsSession('tnl')
|
|
19
|
+
cy.mockConsentAndVisit('/account/add/holiday-stop')
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it('should display add Holiday Stop page', () => {
|
|
23
|
+
cy.get('[data-testid="introduction-title"]').contains('Add a Holiday Stop')
|
|
24
|
+
cy.get('[data-testid="create-holiday-stop"]').should('exist')
|
|
25
|
+
cy.get('[data-testid="create-holiday-stop"]').contains('Choose your dates')
|
|
26
|
+
|
|
27
|
+
cy.get('[id="startDate"]').should('exist')
|
|
28
|
+
cy.get('[id="endDate"]').should('exist')
|
|
29
|
+
|
|
30
|
+
cy.get('[data-testid="primary-button"]').should('exist')
|
|
31
|
+
cy.get('[data-testid="secondary-button"]')
|
|
32
|
+
.should('have.attr', 'href', '/account/holiday-stop')
|
|
33
|
+
.contains('Cancel')
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('should add a new Holiday Stop', () => {
|
|
37
|
+
const [startDate, endDate] = getTestDates()
|
|
38
|
+
|
|
39
|
+
cy.get('[id="startDate"]').should('be.visible').click({ force: true })
|
|
40
|
+
cy.get('input[name="startDate"]').type(startDate)
|
|
41
|
+
cy.get('input[name="endDate"]').type(endDate)
|
|
42
|
+
|
|
43
|
+
cy.get('[data-testid="primary-button"]')
|
|
44
|
+
.should('be.visible')
|
|
45
|
+
.click({ force: true })
|
|
46
|
+
cy.get('[data-testid="modal"]').should('exist')
|
|
47
|
+
cy.get('[data-testid="introduction-title"]').contains('Holiday Stop added')
|
|
48
|
+
cy.get('[data-testid="description-block"]').contains(
|
|
49
|
+
'You have successfully added a Holiday Stop to your account. Your account will be credited no more than 8 weeks after the holiday start date.'
|
|
50
|
+
)
|
|
51
|
+
cy.get('[aria-label="Retun to Holiday Stops"]').click()
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
describe('Upcoming Holiday Stops - edit button', () => {
|
|
56
|
+
beforeEach(() => {
|
|
57
|
+
cy.GetTnlAcsSession('tnl')
|
|
58
|
+
cy.mockConsentAndVisit('/account/holiday-stop')
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
const [startDate] = getTestDates(0, false)
|
|
62
|
+
const [fullStartDate, fullEndDate] = getTestDates()
|
|
63
|
+
const [newStartDate, newEndDate] = getTestDates(1)
|
|
64
|
+
|
|
65
|
+
it('should show redirect to edit page and show corresponding data', () => {
|
|
66
|
+
cy.get('[data-testid="content-list"] > ul > li')
|
|
67
|
+
.contains(startDate)
|
|
68
|
+
.parents('li')
|
|
69
|
+
.contains('Edit')
|
|
70
|
+
.click()
|
|
71
|
+
cy.url().should('match', /\/account\/edit\/holiday-stop?/)
|
|
72
|
+
|
|
73
|
+
cy.get('[name="startDate"]').invoke('val').should('equal', fullStartDate)
|
|
74
|
+
cy.get('[name="endDate"]').invoke('val').should('equal', fullEndDate)
|
|
75
|
+
|
|
76
|
+
cy.get('[id="startDate"]').should('be.visible').click({ force: true })
|
|
77
|
+
|
|
78
|
+
cy.get('input[name="startDate"]').type(`0{selectAll}${newStartDate}`)
|
|
79
|
+
cy.get('input[name="endDate"]').type(`0{selectAll}${newEndDate}`)
|
|
80
|
+
|
|
81
|
+
cy.get('body').click({ force: true })
|
|
82
|
+
cy.contains('[data-testid="primary-button"]', 'Save').click()
|
|
83
|
+
cy.contains('[data-testid="modal"]', 'Holiday Stop updated')
|
|
84
|
+
cy.contains('[data-testid="primary-button"]', 'OK').click()
|
|
85
|
+
cy.url().should('match', /account\/holiday-stop/)
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
describe('Cancel Holiday Stop', () => {
|
|
90
|
+
beforeEach(() => {
|
|
91
|
+
cy.GetTnlAcsSession('tnl')
|
|
92
|
+
cy.mockConsentAndVisit('/account/holiday-stop')
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
it('should show popup and cancel Holiday Stop', () => {
|
|
96
|
+
const [newStartDate] = getTestDates(1, false)
|
|
97
|
+
|
|
98
|
+
cy.get('[data-testid="content-list"] > ul > li')
|
|
99
|
+
.contains(newStartDate)
|
|
100
|
+
.parents('li')
|
|
101
|
+
.contains('Cancel')
|
|
102
|
+
.click()
|
|
103
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
104
|
+
cy.contains(
|
|
105
|
+
'[data-testid="toast-container"]',
|
|
106
|
+
'Your Holiday Stop was successfully cancelled. Cancelled Holiday Stops will not be displayed.'
|
|
107
|
+
)
|
|
108
|
+
})
|
|
109
|
+
})
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
describe('MAIN API', () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.GetAcsSession()
|
|
4
|
+
cy.mockConsentAndVisit('/account')
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
it('mutateUser - name', () => {
|
|
8
|
+
cy.getCookie(Cypress.env('ACCOUNT_PROVIDER_COOKIE_NAME')).then((cookie) => {
|
|
9
|
+
cy.request({
|
|
10
|
+
url: `${Cypress.env('E2E_BASE_URL')}/mutate`,
|
|
11
|
+
method: 'POST',
|
|
12
|
+
headers: {
|
|
13
|
+
Cookie: `${Cypress.env('ACCOUNT_PROVIDER_COOKIE_NAME')}=${
|
|
14
|
+
cookie.value
|
|
15
|
+
}`,
|
|
16
|
+
},
|
|
17
|
+
body: {
|
|
18
|
+
firstName: 'John',
|
|
19
|
+
lastName: 'Smith',
|
|
20
|
+
validationSchemaKey: 'name',
|
|
21
|
+
},
|
|
22
|
+
}).as('mutateUser')
|
|
23
|
+
cy.get('@mutateUser').then((updatedUser) => {
|
|
24
|
+
expect(updatedUser.status).to.eq(200)
|
|
25
|
+
expect(updatedUser.body.data.updateUser.email).to.eq(
|
|
26
|
+
'render.e2e.default@yopmail.com'
|
|
27
|
+
)
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it('mutateUser - mobile', () => {
|
|
33
|
+
cy.getCookie(Cypress.env('ACCOUNT_PROVIDER_COOKIE_NAME')).then((cookie) => {
|
|
34
|
+
cy.request({
|
|
35
|
+
url: `${Cypress.env('E2E_BASE_URL')}/mutate`,
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers: {
|
|
38
|
+
Cookie: `${Cypress.env('ACCOUNT_PROVIDER_COOKIE_NAME')}=${
|
|
39
|
+
cookie.value
|
|
40
|
+
}`,
|
|
41
|
+
},
|
|
42
|
+
body: {
|
|
43
|
+
mobile: '+447777777778',
|
|
44
|
+
validationSchemaKey: 'mobile',
|
|
45
|
+
},
|
|
46
|
+
}).as('mutateUser')
|
|
47
|
+
cy.get('@mutateUser').then((updatedUser) => {
|
|
48
|
+
expect(updatedUser.status).to.eq(200)
|
|
49
|
+
expect(updatedUser.body.data.updateUser.email).to.eq(
|
|
50
|
+
'render.e2e.default@yopmail.com'
|
|
51
|
+
)
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('getUserQuery', () => {
|
|
57
|
+
cy.getCookie(Cypress.env('ACCOUNT_PROVIDER_COOKIE_NAME')).then((cookie) => {
|
|
58
|
+
cy.request({
|
|
59
|
+
url: `${Cypress.env('E2E_BASE_URL')}/query`,
|
|
60
|
+
method: 'POST',
|
|
61
|
+
headers: {
|
|
62
|
+
Cookie: `${Cypress.env('ACCOUNT_PROVIDER_COOKIE_NAME')}=${
|
|
63
|
+
cookie.value
|
|
64
|
+
}`,
|
|
65
|
+
},
|
|
66
|
+
body: {
|
|
67
|
+
queryFragment: 'UserProfile',
|
|
68
|
+
},
|
|
69
|
+
}).as('user')
|
|
70
|
+
cy.get('@user').then((response) => {
|
|
71
|
+
expect(response.status).to.eq(200)
|
|
72
|
+
expect(response.body.email).to.eq('render.e2e.default@yopmail.com')
|
|
73
|
+
expect(response.body.mobile).to.eq('+447777777778')
|
|
74
|
+
expect(response.body.firstName).to.eq('John')
|
|
75
|
+
expect(response.body.lastName).to.eq('Smith')
|
|
76
|
+
expect(response.body.address.city).to.eq('London')
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
it('getUserSubscription', () => {
|
|
82
|
+
cy.getCookie(Cypress.env('ACCOUNT_PROVIDER_COOKIE_NAME')).then((cookie) => {
|
|
83
|
+
cy.request({
|
|
84
|
+
url: `${Cypress.env('E2E_BASE_URL')}/query`,
|
|
85
|
+
method: 'POST',
|
|
86
|
+
headers: {
|
|
87
|
+
Cookie: `${Cypress.env('ACCOUNT_PROVIDER_COOKIE_NAME')}=${
|
|
88
|
+
cookie.value
|
|
89
|
+
}`,
|
|
90
|
+
},
|
|
91
|
+
body: {
|
|
92
|
+
queryFragment: 'UserSubscription',
|
|
93
|
+
},
|
|
94
|
+
}).as('userSubscription')
|
|
95
|
+
cy.get('@userSubscription').then((response) => {
|
|
96
|
+
expect(response.status).to.eq(200)
|
|
97
|
+
expect(response.body.cpn).to.eq('4AAA039437008')
|
|
98
|
+
assert.isArray(response.body.subscriptions)
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
})
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/* eslint-disable no-only-tests/no-only-tests */
|
|
2
|
+
|
|
3
|
+
describe('Newsletters and alerts without/with account', () => {
|
|
4
|
+
beforeEach(() => {
|
|
5
|
+
cy.GetTnlAcsSession('digitalCard')
|
|
6
|
+
cy.mockConsentAndVisit('/account/newsletters-and-alerts')
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
it('Should display page header and description', () => {
|
|
10
|
+
cy.contains('Newsletters & Alerts')
|
|
11
|
+
cy.contains(
|
|
12
|
+
'Manage your newsletters, notifications and all other contact preferences.'
|
|
13
|
+
)
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it('Should display page data', () => {
|
|
17
|
+
cy.contains('Newsletters')
|
|
18
|
+
cy.contains(
|
|
19
|
+
'Get the stories you want to read, direct to your inbox. Choose from a range of daily or weekly newsletters on the subjects that matter to you.'
|
|
20
|
+
)
|
|
21
|
+
cy.get('a[aria-label="Newsletters"]')
|
|
22
|
+
.should('have.attr', 'href')
|
|
23
|
+
.and('match', /\/newsletters/)
|
|
24
|
+
|
|
25
|
+
cy.contains('Commenting notifications')
|
|
26
|
+
cy.contains(
|
|
27
|
+
'We’ll keep you informed on conversations you contribute to or follow, by sending you email notifications. Just let us know when you’d like to be notified.'
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
cy.contains('Contact preferences')
|
|
31
|
+
cy.contains(
|
|
32
|
+
"We'd like to keep in touch, but only if you want us to. Manage how we contact you about marketing, special offers and promotions from our partners."
|
|
33
|
+
)
|
|
34
|
+
cy.get('a[aria-label="Contact preferences"]').should(
|
|
35
|
+
'have.attr',
|
|
36
|
+
'href',
|
|
37
|
+
'#'
|
|
38
|
+
)
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
describe('Newsletters and alerts edit pages', () => {
|
|
43
|
+
beforeEach(() => {
|
|
44
|
+
cy.GetTnlAcsSession('digitalCard')
|
|
45
|
+
cy.mockConsentAndVisit('/account/newsletters-and-alerts')
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
describe('Edit commenting notifications', () => {
|
|
49
|
+
it('Should show user commenting notifications', () => {
|
|
50
|
+
cy.get('a[href="/account/edit/commenting-notifications"]')
|
|
51
|
+
.should('be.visible')
|
|
52
|
+
.click()
|
|
53
|
+
|
|
54
|
+
cy.contains('Edit your commenting notifications')
|
|
55
|
+
cy.contains(
|
|
56
|
+
'We’ll send you email notifications you to keep you informed on conversations you contribute to or follow.'
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
cy.contains('Choose when you’d like to receive notifications:')
|
|
60
|
+
|
|
61
|
+
cy.contains('label', 'When someone mentions me in a comment')
|
|
62
|
+
cy.get('input[name="userMentioned"]').should('not.have.value', 'checked')
|
|
63
|
+
cy.contains('label', 'When someone likes one of my comments')
|
|
64
|
+
cy.get('input[name="likedYourMessage"]').should(
|
|
65
|
+
'not.have.value',
|
|
66
|
+
'checked'
|
|
67
|
+
)
|
|
68
|
+
cy.contains('label', 'When someone replies to one of my comments')
|
|
69
|
+
cy.get('input[name="repliedToMessage"]').should(
|
|
70
|
+
'not.have.value',
|
|
71
|
+
'checked'
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
cy.contains('[data-testid="primary-button"]', 'Save')
|
|
75
|
+
cy.contains('[data-testid="secondary-button"]', 'Cancel')
|
|
76
|
+
|
|
77
|
+
// Redirects to Newsletters and Alerts page
|
|
78
|
+
cy.get('[data-testid="secondary-button"]').click()
|
|
79
|
+
cy.location().should((loc) => {
|
|
80
|
+
expect(loc.pathname).to.eq('/account/newsletters-and-alerts')
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it('Should change user commenting notifications', () => {
|
|
85
|
+
cy.get('a[href="/account/edit/commenting-notifications"]')
|
|
86
|
+
.should('be.visible')
|
|
87
|
+
.click()
|
|
88
|
+
|
|
89
|
+
cy.contains('When someone mentions me in a comment').click()
|
|
90
|
+
cy.contains('When someone likes one of my comments').click()
|
|
91
|
+
cy.contains('When someone replies to one of my comments').click()
|
|
92
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
93
|
+
|
|
94
|
+
cy.contains(
|
|
95
|
+
'[data-testid="toast-container"]',
|
|
96
|
+
'Updating your preferences...'
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
// Redirects to Newsletters and Alerts page
|
|
100
|
+
cy.location().should((loc) => {
|
|
101
|
+
expect(loc.pathname).to.eq('/account/newsletters-and-alerts')
|
|
102
|
+
})
|
|
103
|
+
cy.contains(
|
|
104
|
+
'[data-testid="toast-container"]',
|
|
105
|
+
'Your commenting notifications has been updated'
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
cy.visit('/account/edit/commenting-notifications')
|
|
109
|
+
cy.get('[data-testid="userMentioned"]').should('be.checked')
|
|
110
|
+
cy.get('[data-testid="likedYourMessage"]').should('be.checked')
|
|
111
|
+
cy.get('[data-testid="repliedToMessage"]').should('be.checked')
|
|
112
|
+
cy.contains('When someone mentions me in a comment').click()
|
|
113
|
+
cy.contains('When someone likes one of my comments').click()
|
|
114
|
+
cy.contains('When someone replies to one of my comments').click()
|
|
115
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
116
|
+
|
|
117
|
+
cy.contains(
|
|
118
|
+
'[data-testid="toast-container"]',
|
|
119
|
+
'Updating your preferences...'
|
|
120
|
+
)
|
|
121
|
+
cy.contains(
|
|
122
|
+
'[data-testid="toast-container"]',
|
|
123
|
+
'Your commenting notifications has been updated'
|
|
124
|
+
)
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('Should show error toast when updating commenting notifications if internal server error occures', () => {
|
|
128
|
+
cy.intercept('POST', '/api/account/mutate', { statusCode: 500 })
|
|
129
|
+
|
|
130
|
+
cy.get('a[href="/account/edit/commenting-notifications"]')
|
|
131
|
+
.should('be.visible')
|
|
132
|
+
.click()
|
|
133
|
+
|
|
134
|
+
cy.get('[data-testid="userMentioned"]').check()
|
|
135
|
+
cy.get('[data-testid="likedYourMessage"]').check()
|
|
136
|
+
cy.get('[data-testid="repliedToMessage"]').check()
|
|
137
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
138
|
+
|
|
139
|
+
cy.contains(
|
|
140
|
+
'[data-testid="toast-container"]',
|
|
141
|
+
'Updating your preferences...'
|
|
142
|
+
)
|
|
143
|
+
cy.contains(
|
|
144
|
+
'[data-testid="toast-container"]',
|
|
145
|
+
"Sorry, we're unable to save your commenting notifications right now. Please try again or come back later."
|
|
146
|
+
)
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
describe('Newsletters page', () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.GetTnlAcsSession()
|
|
4
|
+
cy.mockConsentAndVisit('/account/newsletters')
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
it('Should display the newsletters page', () => {
|
|
8
|
+
cy.contains('Newsletters')
|
|
9
|
+
cy.contains(
|
|
10
|
+
'Exclusive content and a curated selection of our top stories straight to your inbox.'
|
|
11
|
+
)
|
|
12
|
+
cy.get('[data-testid="newsletters-grid"] > div').should('have.length', 20)
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
it('Should display all required newsletter text in the first grid card', () => {
|
|
16
|
+
cy.get('[data-testid="newsletters-grid"]').then(($parentDiv) => {
|
|
17
|
+
const firstNewsletter = $parentDiv.find('div:first-child')
|
|
18
|
+
|
|
19
|
+
cy.wrap(firstNewsletter).contains('Business').should('be.visible')
|
|
20
|
+
cy.wrap(firstNewsletter).contains('Daily').should('be.visible')
|
|
21
|
+
cy.wrap(firstNewsletter)
|
|
22
|
+
.contains(
|
|
23
|
+
"The business editor's exclusive analysis of all the latest financial and economic news."
|
|
24
|
+
)
|
|
25
|
+
.should('be.visible')
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it('Should successfully subscribe to a newsletter', () => {
|
|
30
|
+
cy.get('[data-testid="newsletters-grid"]').then(($parentDiv) => {
|
|
31
|
+
cy.intercept('POST', '/api/account/mutate', { statusCode: 200, ok: true })
|
|
32
|
+
|
|
33
|
+
const firstNewsletter = $parentDiv.find('div:first-child')
|
|
34
|
+
|
|
35
|
+
cy.wrap(firstNewsletter)
|
|
36
|
+
.find('[data-testid="switch-wrapper"]')
|
|
37
|
+
.eq(0)
|
|
38
|
+
.should('be.visible')
|
|
39
|
+
.click()
|
|
40
|
+
|
|
41
|
+
cy.contains(
|
|
42
|
+
'[data-testid="toast-container"]',
|
|
43
|
+
'Thank you, you are now signed up to the Business newsletter'
|
|
44
|
+
)
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('Should show the error toast on server error', () => {
|
|
49
|
+
cy.get('[data-testid="newsletters-grid"]').then(($parentDiv) => {
|
|
50
|
+
cy.intercept('POST', '/api/account/mutate', {
|
|
51
|
+
statusCode: 500,
|
|
52
|
+
ok: false,
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const firstNewsletter = $parentDiv.find('div:first-child')
|
|
56
|
+
|
|
57
|
+
cy.wrap(firstNewsletter)
|
|
58
|
+
.find('[data-testid="switch-wrapper"]')
|
|
59
|
+
.eq(0)
|
|
60
|
+
.should('be.visible')
|
|
61
|
+
.click()
|
|
62
|
+
|
|
63
|
+
cy.contains(
|
|
64
|
+
'[data-testid="toast-container"]',
|
|
65
|
+
'Sorry we were unable to sign you up to the Business newsletter, please try again'
|
|
66
|
+
)
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
})
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
describe('My account Payment methods page', () => {
|
|
2
|
+
beforeEach(() => {
|
|
3
|
+
cy.GetTnlAcsSession()
|
|
4
|
+
cy.mockConsentAndVisit('/account/payment-methods')
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
it('should show payment options', () => {
|
|
8
|
+
cy.get('[data-testid="content-list-item-0"]')
|
|
9
|
+
.should('have.attr', 'href', '/account/payment/credit-card')
|
|
10
|
+
.contains('Debit/Credit Card')
|
|
11
|
+
|
|
12
|
+
cy.get('[data-testid="content-list-item-1"]')
|
|
13
|
+
.should('have.attr', 'href', '/account/payment/direct-debit')
|
|
14
|
+
.contains('Direct Debit')
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
describe('My account credit card payment method page', () => {
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
cy.mockConsentAndVisit('/account/payment/credit-card')
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('should load the zuora iFrame', () => {
|
|
24
|
+
cy.get('iframe').should('exist')
|
|
25
|
+
})
|
|
26
|
+
it('should show the credit card payment page title', () => {
|
|
27
|
+
cy.get('[data-testid="introduction-title"]').contains('Debit/Credit Card')
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
describe('My account direct debit payment method page', () => {
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
cy.mockConsentAndVisit('/account/payment/direct-debit')
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('should load the zuora iFrame', () => {
|
|
36
|
+
cy.get('iframe').should('exist')
|
|
37
|
+
})
|
|
38
|
+
it('should show the credit card payment page title', () => {
|
|
39
|
+
cy.get('[data-testid="introduction-title"]').contains(
|
|
40
|
+
'Set up a Direct Debit'
|
|
41
|
+
)
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
describe('My account /payment when used without payment method', () => {
|
|
45
|
+
beforeEach(() => {
|
|
46
|
+
cy.mockConsentAndVisit('/account/payment')
|
|
47
|
+
})
|
|
48
|
+
it('should load the Zuora iframe', () => {
|
|
49
|
+
cy.get('iframe').should('exist')
|
|
50
|
+
})
|
|
51
|
+
it('should show the generic payment page - the Zuora credit card iframe', () => {
|
|
52
|
+
cy.get('[data-testid="introduction-title"]').contains(
|
|
53
|
+
'Edit your payment method'
|
|
54
|
+
)
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
// describe('My account Payment page', () => {
|
|
58
|
+
// beforeEach(() => {
|
|
59
|
+
// cy.mockConsentAndVisit('/account/payment')
|
|
60
|
+
// })
|
|
61
|
+
|
|
62
|
+
// it('should load the zuora iFrame', () => {
|
|
63
|
+
// cy.get('iframe').should('exist')
|
|
64
|
+
// })
|
|
65
|
+
|
|
66
|
+
// it('should successully send the form', () => {
|
|
67
|
+
// if (Cypress.config('chromeWebSecurity')) {
|
|
68
|
+
// throw new Error(
|
|
69
|
+
// 'To get Zuora element `chromeWebSecurity` must be disabled'
|
|
70
|
+
// )
|
|
71
|
+
// }
|
|
72
|
+
|
|
73
|
+
// cy.get('iframe').should('exist')
|
|
74
|
+
// cy.getZuoraElement('input[name="field_creditCardHolderName"]').type(
|
|
75
|
+
// 'Gabriel Dimitrov'
|
|
76
|
+
// )
|
|
77
|
+
// cy.getZuoraElement('input[name="field_creditCardNumber"]').type(
|
|
78
|
+
// '4111 1111 1111 1111'
|
|
79
|
+
// )
|
|
80
|
+
// cy.getZuoraElement('input[name="field_cardSecurityCode"]').type('123')
|
|
81
|
+
// cy.getZuoraElement('input[name="field_creditCardPostalCode"]').type(
|
|
82
|
+
// 'E11 9HB'
|
|
83
|
+
// )
|
|
84
|
+
|
|
85
|
+
// cy.getZuoraElement('select[name="field_creditCardExpirationMonth"]').select(
|
|
86
|
+
// '11'
|
|
87
|
+
// )
|
|
88
|
+
// cy.getZuoraElement('select[name="field_creditCardExpirationYear"]').select(
|
|
89
|
+
// '2026'
|
|
90
|
+
// )
|
|
91
|
+
// cy.getZuoraElement('#submitButton').click()
|
|
92
|
+
|
|
93
|
+
// cy.contains(
|
|
94
|
+
// '[data-testid="toast-container"]',
|
|
95
|
+
// 'Your payment method has been updated'
|
|
96
|
+
// )
|
|
97
|
+
// })
|
|
98
|
+
// })
|