From 198ec3ad173aa386559a348efe3756b8ceb8f6ce Mon Sep 17 00:00:00 2001 From: Vraja Das Date: Wed, 25 Oct 2023 14:41:59 +0200 Subject: [PATCH] Revert "cleanup enzyme text formality test" This reverts commit dce5fcf22d34bb7b5d4c8de809c1dec32b4b83c9. --- .../text-formality-upsell.test.js.snap | 139 ++++++++++++++++++ .../components/text-formality-upsell.test.js | 33 +++++ 2 files changed, 172 insertions(+) create mode 100644 packages/js/tests/insights/components/__snapshots__/text-formality-upsell.test.js.snap create mode 100644 packages/js/tests/insights/components/text-formality-upsell.test.js diff --git a/packages/js/tests/insights/components/__snapshots__/text-formality-upsell.test.js.snap b/packages/js/tests/insights/components/__snapshots__/text-formality-upsell.test.js.snap new file mode 100644 index 00000000000..fd2379e7647 --- /dev/null +++ b/packages/js/tests/insights/components/__snapshots__/text-formality-upsell.test.js.snap @@ -0,0 +1,139 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a test for TextFormalityUpsell component renders the component in Elementor 1`] = ` +.c0 { + border: 0; + -webkit-clip: rect(1px,1px,1px,1px); + clip: rect(1px,1px,1px,1px); + -webkit-clip-path: inset(50%); + clip-path: inset(50%); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute !important; + width: 1px; + word-wrap: normal !important; + -webkit-transform: translateY(1em); + -ms-transform: translateY(1em); + transform: translateY(1em); +} + +
+

+ + Yoast SEO Premium + + will help you assess the formality level of your text. +

+ + Unlock with Premium + +
+`; + +exports[`a test for TextFormalityUpsell component renders the component in metabox 1`] = ` +.c0 { + border: 0; + -webkit-clip: rect(1px,1px,1px,1px); + clip: rect(1px,1px,1px,1px); + -webkit-clip-path: inset(50%); + clip-path: inset(50%); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute !important; + width: 1px; + word-wrap: normal !important; + -webkit-transform: translateY(1em); + -ms-transform: translateY(1em); + transform: translateY(1em); +} + +
+

+ + Yoast SEO Premium + + will help you assess the formality level of your text. +

+ + Unlock with Premium + +
+`; + +exports[`a test for TextFormalityUpsell component renders the component in sidebar 1`] = ` +.c0 { + border: 0; + -webkit-clip: rect(1px,1px,1px,1px); + clip: rect(1px,1px,1px,1px); + -webkit-clip-path: inset(50%); + clip-path: inset(50%); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute !important; + width: 1px; + word-wrap: normal !important; + -webkit-transform: translateY(1em); + -ms-transform: translateY(1em); + transform: translateY(1em); +} + +
+

+ + Yoast SEO Premium + + will help you assess the formality level of your text. +

+ + Unlock with Premium + +
+`; diff --git a/packages/js/tests/insights/components/text-formality-upsell.test.js b/packages/js/tests/insights/components/text-formality-upsell.test.js new file mode 100644 index 00000000000..4b789b70065 --- /dev/null +++ b/packages/js/tests/insights/components/text-formality-upsell.test.js @@ -0,0 +1,33 @@ +import TextFormalityUpsell from "../../../src/insights/components/text-formality-upsell"; +import React from "react"; +import renderer from "react-test-renderer"; + +window.wpseoAdminL10n = { + "shortlinks-insights-upsell-sidebar-text_formality": "https://yoa.st/formality-upsell-sidebar", + "shortlinks-insights-upsell-metabox-text_formality": "https://yoa.st/formality-upsell-metabox", + "shortlinks-insights-upsell-elementor-text_formality": "https://yoa.st/formality-upsell-elementor", +}; + +describe( "a test for TextFormalityUpsell component", () => { + it( "renders the component in sidebar", () => { + const render = renderer.create( ); + + const tree = render.toJSON(); + + expect( tree ).toMatchSnapshot(); + } ); + it( "renders the component in metabox", () => { + const render = renderer.create( ); + + const tree = render.toJSON(); + + expect( tree ).toMatchSnapshot(); + } ); + it( "renders the component in Elementor", () => { + const render = renderer.create( ); + + const tree = render.toJSON(); + + expect( tree ).toMatchSnapshot(); + } ); +} );