mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
created elementCount component and test
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<script lang="ts">
|
||||
export let count: number = 0;
|
||||
</script>
|
||||
|
||||
<p>{count} <slot /> found</p>
|
||||
@@ -16,3 +16,4 @@ export { default as Collapsible } from './collapsible.svelte';
|
||||
export { default as Avatar } from './avatar.svelte';
|
||||
export { default as SwitchBox } from './switchBox.svelte';
|
||||
export { default as SwitchBoxes } from './switchBoxes.svelte';
|
||||
export { default as ElementCount } from './elementCount.svelte';
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import '@testing-library/jest-dom';
|
||||
import { render } from '@testing-library/svelte';
|
||||
import { ElementCount } from '../../../src/lib/components';
|
||||
|
||||
test('shows correct count', () => {
|
||||
const { getByText } = render(ElementCount, {
|
||||
count: 1
|
||||
});
|
||||
expect(getByText(/1/i)).toBeInTheDocument();
|
||||
});
|
||||
Reference in New Issue
Block a user