diff --git a/src/api/__tests__/auth.spec.ts b/src/api/__tests__/auth.spec.ts index bb70c22..005292a 100644 --- a/src/api/__tests__/auth.spec.ts +++ b/src/api/__tests__/auth.spec.ts @@ -43,9 +43,9 @@ describe('auth API', () => { json: async () => ({ message: 'Invalid email or password' }), } as unknown as Response) - await expect( - loginApi({ email: 'user@example.com', password: 'wrong' }), - ).rejects.toThrow('Invalid email or password') + await expect(loginApi({ email: 'user@example.com', password: 'wrong' })).rejects.toThrow( + 'Invalid email or password', + ) }) }) @@ -83,9 +83,7 @@ describe('auth API', () => { }, } as unknown as Response) - await expect( - refreshApi({ refresh_token: 'invalid-token' }), - ).rejects.toThrow('Unauthorized') + await expect(refreshApi({ refresh_token: 'invalid-token' })).rejects.toThrow('Unauthorized') }) }) @@ -115,9 +113,9 @@ describe('auth API', () => { json: async () => ({ error: 'failed to logout' }), } as unknown as Response) - await expect( - logoutApi({ refresh_token: 'invalid-token' }), - ).rejects.toThrow('failed to logout') + await expect(logoutApi({ refresh_token: 'invalid-token' })).rejects.toThrow( + 'failed to logout', + ) }) }) @@ -134,7 +132,7 @@ describe('auth API', () => { method: 'POST', headers: { 'Content-Type': 'application/json', - 'Authorization': 'Bearer access-123', + Authorization: 'Bearer access-123', }, body: JSON.stringify({}), }) diff --git a/src/assets/base.css b/src/assets/base.css index 4262705..1e8b264 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -44,6 +44,11 @@ font-weight: normal; } +ul, +ol { + padding: 0; +} + html { -webkit-tap-highlight-color: transparent; } diff --git a/src/components/ListCard.vue b/src/components/ListCard.vue index dd4035d..2a09e28 100644 --- a/src/components/ListCard.vue +++ b/src/components/ListCard.vue @@ -1,54 +1,155 @@ diff --git a/src/stores/__tests__/lists.spec.ts b/src/stores/__tests__/lists.spec.ts index 95bf7bc..cbe26e7 100644 --- a/src/stores/__tests__/lists.spec.ts +++ b/src/stores/__tests__/lists.spec.ts @@ -84,14 +84,14 @@ vi.mock('@/database/db', () => ({ })) const listsApiMocks = vi.hoisted(() => ({ - getListsApi: vi.fn(), - createListApi: vi.fn(), - getListItemsApi: vi.fn(), - createListItemApi: vi.fn(), - updateListItemApi: vi.fn(), - setListItemCompletedApi: vi.fn(), - addUserToListApi: vi.fn(), - removeUserFromListApi: vi.fn(), + getListsApi: vi.fn<() => Promise>(), + createListApi: vi.fn<() => Promise>(), + getListItemsApi: vi.fn<() => Promise>(), + createListItemApi: vi.fn<() => Promise>(), + updateListItemApi: vi.fn<() => Promise>(), + setListItemCompletedApi: vi.fn<() => Promise>(), + addUserToListApi: vi.fn<() => Promise>(), + removeUserFromListApi: vi.fn<() => Promise>(), })) vi.mock('@/api/lists', () => listsApiMocks) @@ -254,9 +254,7 @@ describe('useListsStore', () => { const store = useListsStore() const localList = await store.createList('Local only') - listsApiMocks.getListsApi.mockResolvedValueOnce([ - { id: localList.id, name: 'Server version' }, - ]) + listsApiMocks.getListsApi.mockResolvedValueOnce([{ id: localList.id, name: 'Server version' }]) await store.pullFromServer() diff --git a/src/stores/lists.ts b/src/stores/lists.ts index e741bf5..255d6ad 100644 --- a/src/stores/lists.ts +++ b/src/stores/lists.ts @@ -211,9 +211,7 @@ export const useListsStore = defineStore('lists', () => { const payload = queueEntry.payload as { list_item_id?: string } await db.syncQueue.update(queueEntry.id!, { localListItemId: newId, - payload: payload?.list_item_id - ? { ...payload, list_item_id: newId } - : queueEntry.payload, + payload: payload?.list_item_id ? { ...payload, list_item_id: newId } : queueEntry.payload, }) } } diff --git a/src/views/ListDetailView.vue b/src/views/ListDetailView.vue index dd6a35a..d338c7d 100644 --- a/src/views/ListDetailView.vue +++ b/src/views/ListDetailView.vue @@ -10,7 +10,6 @@ const router = useRouter() const listsStore = useListsStore() const newItemTitle = ref('') -const newUserId = ref('') const isAddingItem = ref(false) const itemError = ref('') @@ -38,13 +37,6 @@ async function handleAddItem() { isAddingItem.value = false } } - -async function handleAddUser() { - const userId = newUserId.value.trim() - if (!userId) return - await listsStore.addUserToList(props.id, userId) - newUserId.value = '' -}

List not found on this device.

@@ -157,6 +139,8 @@ h1 { .items-list { list-style: none; + padding: 0; + margin: 0; } .empty-hint { @@ -165,28 +149,4 @@ h1 { text-align: center; padding: 1.5rem 0; } - -.share-card { - padding: 1rem 1.1rem; - margin-top: 1.5rem; -} - -.share-card h4 { - font-size: 0.85rem; - margin-bottom: 0.75rem; -} - -.add-user-form { - display: flex; - gap: 0.6rem; -} - -.add-user-form .field { - flex: 1; -} - -.add-user-form .btn { - width: auto; - flex-shrink: 0; -} diff --git a/src/views/ListsView.vue b/src/views/ListsView.vue index 86dd25b..65005d6 100644 --- a/src/views/ListsView.vue +++ b/src/views/ListsView.vue @@ -1,18 +1,29 @@