fix: tests for code snippet

This commit is contained in:
Torsten Dittmann
2022-10-13 14:45:51 +02:00
parent 9039b42e0c
commit 9add33a56e
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -25,7 +25,9 @@
</script>
<section class="box u-overflow-hidden u-min-height-100">
<div class="u-position-absolute u-inset-inline-end-8 u-inset-block-start-8 u-flex u-gap-8">
<div
data-testid="controls"
class="u-position-absolute u-inset-inline-end-8 u-inset-block-start-8 u-flex u-gap-8">
{#if label}
<Pill>{label}</Pill>
{/if}
+2 -2
View File
@@ -4,12 +4,12 @@ import { vi } from 'vitest';
import { Code } from '../../../src/lib/components';
test('default props', async () => {
const { container } = render(Code, {
const { getByTestId } = render(Code, {
code: 'console.log("test");',
language: 'js'
});
expect(container.querySelector('.controls').children.length).toEqual(0);
expect(getByTestId('controls').children.length).toEqual(0);
});
test('shows label', async () => {