plain-api-definition-widget: remove snapshot testing

Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
This commit is contained in:
Vincenzo Scamporlino
2021-08-19 12:21:56 +02:00
parent d041655a7d
commit 8be8f66ea7
3 changed files with 6 additions and 65 deletions
@@ -20,10 +20,13 @@ import { PlainApiDefinitionWidget } from './PlainApiDefinitionWidget';
describe('<PlainApiDefinitionWidget />', () => {
it('renders plain text', async () => {
const { getByTestId } = await renderInTestApp(
const { getAllByText } = await renderInTestApp(
<PlainApiDefinitionWidget definition="Hello World" language="yaml" />,
);
expect(getByTestId('code-snippet')).toMatchSnapshot();
expect(
getAllByText((_text, element) => element?.textContent === 'Hello World')
.length,
).toBeGreaterThan(0);
});
});
@@ -1,62 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<PlainApiDefinitionWidget /> renders plain text 1`] = `
<div
data-testid="code-snippet"
style="position: relative;"
>
<pre
style="display: block; overflow-x: auto; padding: 0.5em; color: rgb(0, 0, 0); background: rgb(248, 248, 255);"
>
<code
class="language-yaml"
style="white-space: pre;"
>
<span>
<span
style="color: rgb(33, 145, 97);"
>
Hello
</span>
<span>
</span>
<span
style="color: rgb(33, 145, 97);"
>
World
</span>
</span>
</code>
</pre>
<div
style="position: absolute; top: 0px; right: 0px;"
>
<button
class="MuiButtonBase-root MuiIconButton-root"
tabindex="0"
title="Text copied to clipboard"
type="button"
>
<span
class="MuiIconButton-label"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root"
data-testid="copy-button"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"
/>
</svg>
</span>
<span
class="MuiTouchRipple-root"
/>
</button>
</div>
</div>
`;