From 8be8f66ea732f5f4229813deaf2e10cdd30f65c1 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 19 Aug 2021 12:21:56 +0200 Subject: [PATCH] plain-api-definition-widget: remove snapshot testing Signed-off-by: Vincenzo Scamporlino --- .../components/CodeSnippet/CodeSnippet.tsx | 2 +- .../PlainApiDefinitionWidget.test.tsx | 7 ++- .../PlainApiDefinitionWidget.test.tsx.snap | 62 ------------------- 3 files changed, 6 insertions(+), 65 deletions(-) delete mode 100644 plugins/api-docs/src/components/PlainApiDefinitionWidget/__snapshots__/PlainApiDefinitionWidget.test.tsx.snap diff --git a/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx b/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx index 613dff80a9..a3badaad07 100644 --- a/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx +++ b/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx @@ -42,7 +42,7 @@ export const CodeSnippet = ({ const mode = theme.palette.type === 'dark' ? dark : docco; const highlightColor = theme.palette.type === 'dark' ? '#256bf3' : '#e6ffed'; return ( -
+
', () => { it('renders plain text', async () => { - const { getByTestId } = await renderInTestApp( + const { getAllByText } = await renderInTestApp( , ); - expect(getByTestId('code-snippet')).toMatchSnapshot(); + expect( + getAllByText((_text, element) => element?.textContent === 'Hello World') + .length, + ).toBeGreaterThan(0); }); }); diff --git a/plugins/api-docs/src/components/PlainApiDefinitionWidget/__snapshots__/PlainApiDefinitionWidget.test.tsx.snap b/plugins/api-docs/src/components/PlainApiDefinitionWidget/__snapshots__/PlainApiDefinitionWidget.test.tsx.snap deleted file mode 100644 index 85f93c65ae..0000000000 --- a/plugins/api-docs/src/components/PlainApiDefinitionWidget/__snapshots__/PlainApiDefinitionWidget.test.tsx.snap +++ /dev/null @@ -1,62 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` renders plain text 1`] = ` -
-
-    
-      
-        
-          Hello
-        
-        
-           
-        
-        
-          World
-        
-      
-    
-  
-
- -
-
-`;