Minor updates to test code

This commit is contained in:
Ryan Gossiaux
2023-06-10 20:58:18 -07:00
parent f81c75214e
commit 8eb08feb03
2 changed files with 1 additions and 5 deletions

View File

@@ -259,7 +259,7 @@ describe('Rendering', () => {
// Try to click one a few options
await click(document.querySelector('[data-value="slot-prop"]'))
// Make sure that the onChange handler got called
// Make sure that the value changed
expect(get(value)).toEqual("slot-prop");
})

View File

@@ -1,7 +1,6 @@
<script lang="ts" context="module">
type HandlerType = (event?: CustomEvent) => any;
interface ComponentProps {
onChange?: HandlerType;
onClose?: HandlerType;
onFocus?: HandlerType;
onKeydown?: HandlerType;
@@ -34,7 +33,6 @@
export let allProps: TestRendererProps;
let spreadProps = {};
let onChange: HandlerType = () => {};
let onClose: HandlerType = () => {};
let onFocus: HandlerType = () => {};
let onKeydown: HandlerType = () => {};
@@ -42,7 +40,6 @@
let onClick: HandlerType = () => {};
if (allProps && typeof allProps !== "string" && isSingleComponent(allProps)) {
({
onChange = onChange,
onClose = onClose,
onFocus = onFocus,
onKeydown = onKeydown,
@@ -61,7 +58,6 @@
<svelte:component
this={allProps[0]}
{...spreadProps}
on:change={onChange}
on:close={onClose}
on:focus={onFocus}
on:keydown={onKeydown}