diff --git a/electron/main.ts b/electron/main.ts index 13f267414c..12e4fe7170 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -33,7 +33,7 @@ app.setPath( 'userData', join( app.getPath('appData'), - appLongName.toLowerCase().replace(' ', '-') + '-test', + appLongName.toLowerCase().replaceAll(' ', '-') + '-test', ), ) @@ -42,7 +42,7 @@ if (isDev) { 'userData', join( app.getPath('appData'), - appLongName.toLowerCase().replace(' ', '-') + '-dev', + appLongName.toLowerCase().replaceAll(' ', '-') + '-dev', ), ) } diff --git a/src/utils/prefs.ts b/src/utils/prefs.ts index dc7004faf3..5c7e1faafb 100644 --- a/src/utils/prefs.ts +++ b/src/utils/prefs.ts @@ -587,7 +587,7 @@ export async function getCongPrefs() { id: basename(file, '.json').replace('prefs-', ''), name: // @ts-expect-error: 'app.congregationName' is not defined as a key of PrefStore - prefs.app.congregationName ?? (prefs.congregationName as string), + prefs.app?.congregationName ?? (prefs.congregationName as string), path: file, } }) diff --git a/tests/helpers/electronHelpers.ts b/tests/helpers/electronHelpers.ts index 5d813b1e8f..462cff2496 100644 --- a/tests/helpers/electronHelpers.ts +++ b/tests/helpers/electronHelpers.ts @@ -76,7 +76,8 @@ export async function openHomePage( const prefs = prefsObject ?? prefsNew const appPath = (await ipcRendererInvoke(page, 'userData')) as string - expect(appPath.endsWith(name)).toBe(true) + console.log(appPath) + expect(appPath.includes(name)).toEqual(true) const downloadsPath = (await ipcRendererInvoke(page, 'downloads')) as string if (prefs.app) { @@ -89,7 +90,7 @@ export async function openHomePage( ? prefs.app.congregationName : prefs.congregationName - const onCongSelect = (await page.locator('.fa-building-user').count()) > 0 + const onCongSelect = (await page.locator('.cong-select').count()) > 0 // Insert mock preferences try { @@ -104,10 +105,7 @@ export async function openHomePage( } else if (page.url().includes('settings')) { // Open the home page as test congregation await page.reload({ waitUntil: 'domcontentloaded' }) - if ( - nrOfCongs > 1 && - (await page.locator('.fa-building-user').count()) > 0 - ) { + if (nrOfCongs > 1 && (await page.locator('.cong-select').count()) > 0) { await selectCong(page, congName) } } diff --git a/tests/home/shuffle.test.ts b/tests/home/shuffle.test.ts index 6928ffa082..58a58c0bac 100644 --- a/tests/home/shuffle.test.ts +++ b/tests/home/shuffle.test.ts @@ -61,7 +61,6 @@ test('shuffle button works correctly', async () => { await shuffleBtn.click() // Wait for stop icon to appear - // eslint-disable-next-line playwright/no-wait-for-selector await page.waitForSelector('.fa-stop') await delay(4 * MS_IN_SEC)