fix: tests

This commit is contained in:
Torsten Dittmann
2022-11-14 21:29:01 +01:00
parent 5cc20d5dfb
commit 33e6fee01c
3 changed files with 15 additions and 2 deletions
-1
View File
@@ -6,7 +6,6 @@ import { page } from '$app/stores';
const analytics = Analytics({
app: 'appwrite',
debug: dev,
plugins: [
googleAnalytics({
measurementIds: [globalThis.GOOGLE_ANALYTICS]
+11
View File
@@ -1,6 +1,7 @@
<script lang="ts">
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
import { Alert } from '$lib/components';
import { trackEvent } from '$lib/actions/analytics';
export let show = false;
export let size: 'small' | 'big' = null;
@@ -23,6 +24,9 @@
function handleBLur(event: MouseEvent) {
if (event.target === dialog) {
trackEvent('click_close_modal', {
from: 'backdrop'
});
closeModal();
}
}
@@ -47,6 +51,9 @@
function handleKeydown(event: KeyboardEvent) {
if (event.key === 'Escape') {
event.preventDefault();
trackEvent('click_close_modal', {
from: 'escape'
});
closeModal();
}
}
@@ -87,6 +94,10 @@
class="x-button"
aria-label="Close Modal"
title="Close Modal"
on:click={() =>
trackEvent('click_close_modal', {
from: 'button'
})}
on:click={closeModal}>
<span class="icon-x" aria-hidden="true" />
</button>
+4 -1
View File
@@ -23,7 +23,10 @@ const config = {
environment: 'jsdom',
globals: true,
threads: true,
setupFiles: ['./tests/unit/setup.ts']
setupFiles: ['./tests/unit/setup.ts'],
deps: {
inline: ['@analytics/type-utils']
}
}
};