Skip to content

Commit 0bd91e8

Browse files
committed
Tests update
1 parent 3d9be46 commit 0bd91e8

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/routes/(v2)/v2/issue-345/+page.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import { page } from '$app/stores';
33
import { superForm } from '$lib/index.js';
44
import SuperDebug from '$lib/index.js';
5-
import CheckboxComponent from './CheckboxComponent.svelte';
5+
//import CheckboxComponent from './CheckboxComponent.svelte';
66
import CheckboxField from './CheckboxField.svelte';
77
88
export let data;
99
1010
const form = superForm(data.form, { taintedMessage: false });
1111
12-
const { form: formStore, errors, message, constraints, enhance } = form;
12+
const { form: formStore, message, enhance } = form;
1313
</script>
1414

1515
<SuperDebug data={$formStore} />
@@ -23,10 +23,10 @@
2323
{/if}
2424

2525
<form method="POST" use:enhance>
26-
<CheckboxComponent bind:checked={$formStore.checkbox} />
26+
<!-- CheckboxComponent bind:checked={$formStore.checkbox} /-->
2727

2828
<!-- Comment the above line, uncomment this line, and reload to cause the failure on SSR (infinite loop). -->
29-
<!-- CheckboxField {form} field="checkbox" description="checkbox" / -->
29+
<CheckboxField {form} field="checkbox" description="checkbox" />
3030

3131
<button>Submit</button>
3232
</form>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
export let checked = false;
2+
export let checked = false;
33
</script>
44

5-
<input type="checkbox" bind:checked {...$$restProps} />
5+
<input type="checkbox" bind:checked {...$$restProps} />
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script lang="ts" context="module">
22
type UnknownRecord = Record<string, unknown>;
3-
43
type T = UnknownRecord;
54
</script>
65

@@ -11,9 +10,12 @@
1110
import CheckboxComponent from './CheckboxComponent.svelte';
1211
export let form: SuperForm<T>;
1312
export let field: FormPathLeaves<T>;
13+
export let description: string;
1414
15-
const { value, errors } = formFieldProxy(form, field);
16-
$: boolValue = value as Writable<boolean>;
15+
const { value } = formFieldProxy(form, field);
16+
// Cannot use $: in Svelte 4, must be const:
17+
const boolValue = value as Writable<boolean>;
1718
</script>
1819

1920
<CheckboxComponent bind:checked={$boolValue} />
21+
{description}

0 commit comments

Comments
 (0)