adds playwright tests
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
describe('sum test', () => {
|
||||
it('adds 1 + 2 to equal 3', () => {
|
||||
expect(1 + 2).toBe(3);
|
||||
});
|
||||
});
|
||||
@@ -23,7 +23,7 @@
|
||||
<button class="btn-secondary" on:click={closeModal}
|
||||
>{$_("cancel")}</button
|
||||
>
|
||||
<button class="btn-danger" type="button" on:click={confirm}
|
||||
<button class="btn-danger" type="button" on:click={confirm} name="delete"
|
||||
>{$_("delete")}</button
|
||||
>
|
||||
</div></Modal
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
<button class="btn-secondary" on:click={closeModal}
|
||||
>{$_("cancel")}</button
|
||||
>
|
||||
<button class="btn-primary" type="submit" form="list-form"
|
||||
<button class="btn-primary" type="submit" form="list-form" name="save"
|
||||
>{$_("save")}</button
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -116,10 +116,12 @@
|
||||
</div>
|
||||
<hr class="my-6 border-input-border" />
|
||||
<div class="flex flex-col basis-full">
|
||||
<a class="btn-primary btn-large text-center mx-4" href="/trail/edit/new"
|
||||
><i class="fa fa-plus mr-2"></i>{$_("new-trail")}</a
|
||||
>
|
||||
{#if $currentUser}
|
||||
<a
|
||||
class="btn-primary btn-large text-center mx-4"
|
||||
href="/trail/edit/new"
|
||||
><i class="fa fa-plus mr-2"></i>{$_("new-trail")}</a
|
||||
>
|
||||
<div class="basis-full"></div>
|
||||
<hr class="border-input-border" />
|
||||
<div class="flex gap-4 items-center m-4">
|
||||
@@ -138,6 +140,10 @@
|
||||
></i></button
|
||||
>
|
||||
</div>
|
||||
{:else}
|
||||
<a class="btn-primary btn-large text-center mx-4" href="/login"
|
||||
>{$_("login")}</a
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</Drawer>
|
||||
@@ -179,7 +185,9 @@
|
||||
: 'moon'}"
|
||||
on:click={() => toggleTheme()}
|
||||
></button>
|
||||
<a class="btn-primary btn-large" href="/trail/edit/new"
|
||||
<a
|
||||
class="btn-primary btn-large"
|
||||
href="/trail/edit/new"
|
||||
><i class="fa fa-plus mr-2"></i>{$_("new-trail")}</a
|
||||
>
|
||||
<Dropdown
|
||||
|
||||
@@ -29,9 +29,7 @@
|
||||
openListModal();
|
||||
}
|
||||
|
||||
async function saveList(
|
||||
e: CustomEvent<{ list: List; avatar?: File }>,
|
||||
) {
|
||||
async function saveList(e: CustomEvent<{ list: List; avatar?: File }>) {
|
||||
const result = e.detail;
|
||||
if (result.list.id) {
|
||||
await lists_update(result.list, result.avatar);
|
||||
@@ -39,7 +37,6 @@
|
||||
await lists_create(result.list, result.avatar);
|
||||
}
|
||||
await lists_index();
|
||||
|
||||
}
|
||||
|
||||
async function handleDropdownClick(
|
||||
@@ -82,23 +79,23 @@
|
||||
on:click={beforeListModalOpen}
|
||||
>
|
||||
<i class="fa fa-plus text-xl aspect-square"></i>
|
||||
<h5 class="text-xl font-semibold">{$_("create-new-list")}</h5>
|
||||
<h5 id="create-list-button" class="text-xl font-semibold">
|
||||
{$_("create-new-list")}
|
||||
</h5>
|
||||
</button>
|
||||
<hr class="border-separator my-2" />
|
||||
<div>
|
||||
{#each $lists as item, i}
|
||||
<li on:click={() => list.set(item)} role="presentation">
|
||||
<ListCard
|
||||
list={item}
|
||||
on:change={(e) => handleDropdownClick(e, item)}
|
||||
active={item.id === $list.id}
|
||||
></ListCard>
|
||||
{#if i != $lists.length - 1}
|
||||
<hr class="border-separator my-2" />
|
||||
{/if}
|
||||
</li>
|
||||
{/each}
|
||||
</div>
|
||||
{#each $lists as item, i}
|
||||
<li class="list-list-item" on:click={() => list.set(item)} role="presentation">
|
||||
<ListCard
|
||||
list={item}
|
||||
on:change={(e) => handleDropdownClick(e, item)}
|
||||
active={item.id === $list.id}
|
||||
></ListCard>
|
||||
{#if i != $lists.length - 1}
|
||||
<hr class="border-separator my-2" />
|
||||
{/if}
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
<TrailList
|
||||
bind:filter
|
||||
|
||||
Reference in New Issue
Block a user