Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions packages/app/e2e/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,49 @@ args = ["other.js"]
}
})

test('opens the detail view for a project with no filesystem paths', async () => {
// Regression: core's toFull omits `paths` for path-less projects (trips,
// partnerships). ProjectDetailView read `project.paths.length` unguarded,
// which threw and — with no error boundary — blanked the whole app.
const home = mkdtempSync(resolve(tmpdir(), 'setlist-e2e-pathless-home-'))
const dbPath = join(home, 'registry.db')
const app = await electron.launch({
args: [MAIN_ENTRY],
env: { ...process.env, HOME: home, SETLIST_APP_DB_PATH: dbPath }
})

try {
const window = await app.firstWindow()
await window.waitForLoadState('domcontentloaded')

await window.evaluate(() => window.setlist.register({
name: 'pathless-trip',
display_name: 'Pathless Trip',
type: 'project',
status: 'active',
description: 'A trip with no filesystem path'
}))
await window.reload()
await window.waitForLoadState('domcontentloaded')

// Click the project card on the Home view.
await window.getByRole('button', { name: /Pathless Trip/ }).first().click()

// The detail view must render, not blank out: header heading + the tab
// strip (which only exists in the detail view) confirm the tree mounted.
await expect(window.getByRole('heading', { name: 'Pathless Trip' }).first()).toBeVisible()
await expect(window.getByRole('tab', { name: 'Overview' })).toBeVisible()
// The error boundary must not have caught a render throw.
await expect(window.getByText('Something went wrong rendering this view')).toHaveCount(0)
// Force-exit before teardown: menu-bar persistence makes window close
// hide rather than quit, so app.close() can hang waiting for process exit.
await app.evaluate(({ app }) => app.exit(0)).catch(() => {})
} finally {
await app.close()
rmSync(home, { recursive: true, force: true })
}
})

test('reassigns projects before deleting a project type from Settings', async () => {
const home = mkdtempSync(resolve(tmpdir(), 'setlist-e2e-type-delete-home-'))
const dbPath = join(home, 'registry.db')
Expand Down
Loading
Loading