add test ids

This commit is contained in:
cupcakearmy 2022-07-19 16:11:24 +02:00
parent fd8fbd2e2e
commit c3bc32bb2b
No known key found for this signature in database
GPG Key ID: 3235314B4D31232F
3 changed files with 27 additions and 6 deletions

View File

@ -12,6 +12,7 @@
<div class="fields">
<TextInput
data-testid="field-views"
type="number"
label={$t('common.views', { values: { n: 0 } })}
bind:value={note.views}
@ -22,9 +23,15 @@
$t('home.errors.max', { values: { n: $status?.max_views ?? 0 } })}
/>
<div class="middle-switch">
<Switch label={$t('common.mode')} bind:value={timeExpiration} color={false} />
<Switch
data-testid="switch-advanced-toggle"
label={$t('common.mode')}
bind:value={timeExpiration}
color={false}
/>
</div>
<TextInput
data-testid="field-expiration"
type="number"
label={$t('common.minutes', { values: { n: 0 } })}
bind:value={note.expiration}

View File

@ -34,7 +34,7 @@
<small>
{label}
</small>
<input type="file" on:change={onInput} multiple />
<input {...$$restProps} type="file" on:change={onInput} multiple />
<div class="box">
{#if files.length}
<div>

View File

@ -106,15 +106,29 @@
<form on:submit|preventDefault={submit}>
<fieldset disabled={loading !== null}>
{#if isFile}
<FileUpload label={$t('common.file')} bind:files />
<FileUpload data-testid="file-upload" label={$t('common.file')} bind:files />
{:else}
<TextArea label={$t('common.note')} bind:value={note.contents} placeholder="..." />
<TextArea
data-testid="text-field"
label={$t('common.note')}
bind:value={note.contents}
placeholder="..."
/>
{/if}
<div class="bottom">
<Switch class="file" label={$t('common.file')} bind:value={isFile} />
<Switch
data-testid="switch-file"
class="file"
label={$t('common.file')}
bind:value={isFile}
/>
{#if $status?.allow_advanced}
<Switch label={$t('common.advanced')} bind:value={advanced} />
<Switch
data-testid="switch-advanced"
label={$t('common.advanced')}
bind:value={advanced}
/>
{/if}
<div class="grow" />
<div class="tr">