diff --git a/src/utils/PlatformServiceMixin.ts b/src/utils/PlatformServiceMixin.ts index c4ca4801..fcd73201 100644 --- a/src/utils/PlatformServiceMixin.ts +++ b/src/utils/PlatformServiceMixin.ts @@ -52,7 +52,11 @@ import { logger } from "@/utils/logger"; import { Contact, ContactMaybeWithJsonStrings } from "@/db/tables/contacts"; import { Account } from "@/db/tables/accounts"; import { Temp } from "@/db/tables/temp"; -import { QueryExecResult, DatabaseExecResult } from "@/interfaces/database"; +import { + QueryExecResult, + DatabaseExecResult, + SqlValue, +} from "@/interfaces/database"; import { generateInsertStatement, generateUpdateStatement, @@ -285,7 +289,7 @@ export const PlatformServiceMixin = { return []; } - return result.values.map((row: unknown[]) => row[0] as string); + return result.values.map((row: SqlValue[]) => row[0] as string); } catch (error) { logger.error( "[PlatformServiceMixin] Error getting available account DIDs:", @@ -498,7 +502,10 @@ export const PlatformServiceMixin = { /** * Enhanced database single row query method with error handling */ - async $dbGetOneRow(sql: string, params?: unknown[]) { + async $dbGetOneRow( + sql: string, + params?: unknown[], + ): Promise { try { // eslint-disable-next-line @typescript-eslint/no-explicit-any return await (this as any).platformService.dbGetOneRow(sql, params); @@ -699,7 +706,7 @@ export const PlatformServiceMixin = { if (availableAccounts?.values?.length) { const accountDids = availableAccounts.values.map( - (row: unknown[]) => row[0] as string, + (row: SqlValue[]) => row[0] as string, ); logger.debug( "[PlatformServiceMixin] Available accounts for user selection:", @@ -749,7 +756,9 @@ export const PlatformServiceMixin = { const result = await this.$dbQuery( "SELECT did FROM accounts ORDER BY dateCreated, did", ); - return result?.values?.map((row: unknown[]) => row[0] as string) || []; + return ( + result?.values?.map((row: Array) => row[0] as string) || [] + ); }, /** @@ -856,7 +865,7 @@ export const PlatformServiceMixin = { async $one( sql: string, params: unknown[] = [], - ): Promise { + ): Promise { // eslint-disable-next-line @typescript-eslint/no-explicit-any return await (this as any).platformService.dbGetOneRow(sql, params); }, @@ -1900,7 +1909,10 @@ export interface IPlatformServiceMixin { params?: unknown[], ): Promise; $dbExec(sql: string, params?: unknown[]): Promise; - $dbGetOneRow(sql: string, params?: unknown[]): Promise; + $dbGetOneRow( + sql: string, + params?: unknown[], + ): Promise; $getMasterSettings(fallback?: Settings | null): Promise; $getMergedSettings( defaultKey: string, @@ -2004,7 +2016,7 @@ declare module "@vue/runtime-core" { // Ultra-concise database methods (shortest possible names) $db(sql: string, params?: unknown[]): Promise; $exec(sql: string, params?: unknown[]): Promise; - $one(sql: string, params?: unknown[]): Promise; + $one(sql: string, params?: unknown[]): Promise; // Query + mapping combo methods $query>( diff --git a/test-playwright/60-new-activity.spec.ts b/test-playwright/60-new-activity.spec.ts index 743c768e..bb13e79a 100644 --- a/test-playwright/60-new-activity.spec.ts +++ b/test-playwright/60-new-activity.spec.ts @@ -71,6 +71,22 @@ test('New offers for another user', async ({ page }) => { await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone + // Handle backup seed modal if it appears (following 00-noid-tests.spec.ts pattern) + try { + // Wait for backup seed modal to appear + await page.waitForFunction(() => { + const alert = document.querySelector('div[role="alert"]'); + return alert && alert.textContent?.includes('Backup Your Identifier Seed'); + }, { timeout: 3000 }); + + // Dismiss backup seed modal + await page.getByRole('button', { name: 'No, Remind me Later' }).click(); + await expect(page.locator('div[role="alert"]').filter({ hasText: 'Backup Your Identifier Seed' })).toBeHidden(); + } catch (error) { + // Backup modal might not appear, that's okay + console.log('Backup seed modal did not appear, continuing...'); + } + // make another offer to user 1 const randomString2 = Math.random().toString(36).substring(2, 5); await page.getByTestId('offerButton').click();