mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 08:16:28 +00:00
test ids
This commit is contained in:
parent
edbf8a8ecf
commit
41f55c0920
@ -50,7 +50,8 @@
|
||||
password: password,
|
||||
id: response.id,
|
||||
}
|
||||
} catch {
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
error = 'could not create note.'
|
||||
} finally {
|
||||
loading = false
|
||||
@ -69,6 +70,7 @@
|
||||
label="share link"
|
||||
value="{window.location.origin}/note/{result.id}/{result.password}"
|
||||
copy
|
||||
data-testid="note-share-link"
|
||||
/>
|
||||
<br />
|
||||
<p>
|
||||
@ -84,11 +86,16 @@
|
||||
{:else}
|
||||
<form on:submit|preventDefault={submit}>
|
||||
<fieldset disabled={loading}>
|
||||
<TextArea label="note" bind:value={note.contents} placeholder="..." />
|
||||
<TextArea
|
||||
label="note"
|
||||
bind:value={note.contents}
|
||||
placeholder="..."
|
||||
data-testid="input-note"
|
||||
/>
|
||||
|
||||
<div class="bottom">
|
||||
<Switch label="advanced" bind:value={advanced} />
|
||||
<Button type="submit">create</Button>
|
||||
<Button type="submit" data-testid="button-create">create</Button>
|
||||
</div>
|
||||
|
||||
{#if error}
|
||||
|
@ -55,10 +55,12 @@
|
||||
|
||||
{#if !loading}
|
||||
{#if !exists}
|
||||
<p class="error-text">note was not found or was already deleted.</p>
|
||||
<p class="error-text" data-testid="note-not-found">
|
||||
note was not found or was already deleted.
|
||||
</p>
|
||||
{:else if note && !error}
|
||||
<p class="error-text">you will not get the chance to see the note again.</p>
|
||||
<div class="note">
|
||||
<div class="note" data-testid="note-result">
|
||||
{note.contents}
|
||||
</div>
|
||||
<br />
|
||||
@ -67,7 +69,7 @@
|
||||
<form on:submit|preventDefault={show}>
|
||||
<fieldset>
|
||||
<p>click below to show and delete the note if the counter has reached it's limit</p>
|
||||
<Button type="submit">show note</Button>
|
||||
<Button type="submit" data-testid="button-show">show note</Button>
|
||||
{#if error}
|
||||
<br />
|
||||
<p class="error-text">
|
||||
|
Loading…
Reference in New Issue
Block a user