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 // Try to click one a few options
await click(document.querySelector('[data-value="slot-prop"]')) 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"); expect(get(value)).toEqual("slot-prop");
}) })

View File

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