Skip to content

Commit

Permalink
chore: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdvlpr committed Feb 25, 2024
1 parent 11b5929 commit 11611ca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ app.setPath(
'userData',
join(
app.getPath('appData'),
appLongName.toLowerCase().replace(' ', '-') + '-test',
appLongName.toLowerCase().replaceAll(' ', '-') + '-test',
),
)

Expand All @@ -42,7 +42,7 @@ if (isDev) {
'userData',
join(
app.getPath('appData'),
appLongName.toLowerCase().replace(' ', '-') + '-dev',
appLongName.toLowerCase().replaceAll(' ', '-') + '-dev',
),
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/prefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
})
Expand Down
10 changes: 4 additions & 6 deletions tests/helpers/electronHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand All @@ -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)
}
}
Expand Down
1 change: 0 additions & 1 deletion tests/home/shuffle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Check warning on line 64 in tests/home/shuffle.test.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected use of page.waitForSelector()
await delay(4 * MS_IN_SEC)

Expand Down

0 comments on commit 11611ca

Please sign in to comment.