From 501c983b99df5ed16b0d2369f1b7459ff0de2dbd Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 19 Mar 2025 19:10:51 -0700 Subject: [PATCH] test: Fix tests --- src/lib/components/Actions.svelte | 8 +- src/lib/components/CopyInput.svelte | 6 +- .../DiagramDocumentationButton.svelte | 2 + src/lib/components/Editor.svelte | 3 +- src/lib/constants.ts | 7 + tests/actions.spec.ts | 42 +++--- tests/diagramUpdate.spec.ts | 122 +++--------------- tests/docMap.spec.ts | 54 ++++---- tests/test.ts | 104 +++++++++++++++ tests/utils.ts | 4 +- 10 files changed, 188 insertions(+), 164 deletions(-) create mode 100644 src/lib/constants.ts create mode 100644 tests/test.ts diff --git a/src/lib/components/Actions.svelte b/src/lib/components/Actions.svelte index e05693e6..a1773723 100644 --- a/src/lib/components/Actions.svelte +++ b/src/lib/components/Actions.svelte @@ -6,6 +6,7 @@ import { Input } from '$/components/ui/input'; import { Separator } from '$/components/ui/separator'; import * as ToggleGroup from '$/components/ui/toggle-group'; + import { TID } from '$/constants'; import { env } from '$/util/env'; import { browser } from '$app/environment'; import { waitForRender } from '$lib/util/autoSync'; @@ -190,7 +191,10 @@ ${svgString}`); {#snippet dualActionButton(text: string, download: (event: Event) => unknown, url?: string)}
- @@ -238,7 +242,7 @@ ${svgString}`); {/if} {#if $urlsStore.mdCode} - + {/if}
diff --git a/src/lib/components/CopyInput.svelte b/src/lib/components/CopyInput.svelte index b01937dd..e3eeac8f 100644 --- a/src/lib/components/CopyInput.svelte +++ b/src/lib/components/CopyInput.svelte @@ -7,14 +7,16 @@ let { value, label = 'Copy', - type = 'url' - }: { value: string; label?: string; type?: InputType } = $props(); + type = 'url', + testID + }: { value: string; label?: string; type?: InputType; testID?: string } = $props();
{ event.currentTarget.setSelectionRange(0, event.currentTarget.value.length); }} /> diff --git a/src/lib/components/DiagramDocumentationButton.svelte b/src/lib/components/DiagramDocumentationButton.svelte index d37bc206..b2449c01 100644 --- a/src/lib/components/DiagramDocumentationButton.svelte +++ b/src/lib/components/DiagramDocumentationButton.svelte @@ -1,5 +1,6 @@