yarn fmt lint tsc

This commit is contained in:
lee-at-zoo-corp
2025-04-01 17:20:35 -04:00
parent 65adfd4497
commit 00122aae5e
8 changed files with 113 additions and 55 deletions

View File

@ -13,7 +13,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
// Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) { fail() }
if (!app || !app.applicationMenu) {
fail()
}
const newProject =
app.applicationMenu.getMenuItemById('File.New project')
if (!newProject) fail()
@ -36,7 +38,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
if (!app || !app.applicationMenu) fail()
const openProject =
app.applicationMenu.getMenuItemById('File.Open project')
if (!openProject) { fail() }
if (!openProject) {
fail()
}
openProject.click()
})
// Check that the command bar is opened
@ -57,7 +61,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
// Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) { fail() }
if (!app || !app.applicationMenu) {
fail()
}
const userSettings = app.applicationMenu.getMenuItemById(
'File.Preferences.User settings'
)
@ -77,7 +83,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
cmdBar,
page,
}) => {
if (!tronApp) { fail() }
if (!tronApp) {
fail()
}
// Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
await tronApp.electron.evaluate(async ({ app }) => {
@ -85,7 +93,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
const keybindings = app.applicationMenu.getMenuItemById(
'File.Preferences.Keybindings'
)
if (!keybindings) { fail() }
if (!keybindings) {
fail()
}
keybindings.click()
})
const settings = page.getByTestId('settings-dialog-panel')
@ -103,7 +113,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
// Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) { fail() }
if (!app || !app.applicationMenu) {
fail()
}
const menu = app.applicationMenu.getMenuItemById(
'File.Preferences.User default units'
)
@ -124,7 +136,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
const menu = app.applicationMenu.getMenuItemById(
'File.Preferences.Theme'
)
if (!menu) { fail() }
if (!menu) {
fail()
}
menu.click()
})
// Check that the command bar is opened
@ -145,7 +159,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
// Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) { fail() }
if (!app || !app.applicationMenu) {
fail()
}
const menu = app.applicationMenu.getMenuItemById(
'File.Preferences.Theme color'
)
@ -168,7 +184,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) fail()
const menu = app.applicationMenu.getMenuItemById('File.Sign out')
if (!menu) { fail() }
if (!menu) {
fail()
}
// FIXME: Add back when you can actually sign out
// menu.click()
})
@ -185,7 +203,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
// Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) { fail() }
if (!app || !app.applicationMenu) {
fail()
}
const menu = app.applicationMenu.getMenuItemById(
'Edit.Rename project'
)
@ -208,7 +228,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
const menu = app.applicationMenu.getMenuItemById(
'Edit.Delete project'
)
if (!menu) { fail() }
if (!menu) {
fail()
}
menu.click()
})
// Check the placeholder project name exists
@ -227,7 +249,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
// Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) { fail() }
if (!app || !app.applicationMenu) {
fail()
}
const menu = app.applicationMenu.getMenuItemById(
'Edit.Change project directory'
)
@ -254,7 +278,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
const menu = app.applicationMenu.getMenuItemById(
'View.Command Palette...'
)
if (!menu) { fail() }
if (!menu) {
fail()
}
menu.click()
})
// Check the placeholder project name exists
@ -268,7 +294,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
// Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) { fail() }
if (!app || !app.applicationMenu) {
fail()
}
const menu = app.applicationMenu.getMenuItemById(
'Help.Show all commands'
)
@ -288,7 +316,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
const menu = app.applicationMenu.getMenuItemById(
'Help.KCL code samples'
)
if (!menu) { fail() }
if (!menu) {
fail()
}
})
})
test('Home.Help.Refresh and report a bug', async ({
@ -300,7 +330,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
// Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) { fail() }
if (!app || !app.applicationMenu) {
fail()
}
const menu = app.applicationMenu.getMenuItemById(
'Help.Refresh and report a bug'
)
@ -323,7 +355,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
const menu = app.applicationMenu.getMenuItemById(
'Help.Reset onboarding'
)
if (!menu) { fail() }
if (!menu) {
fail()
}
menu.click()
})