Create a workspace in the environment test fixtures

Fresh databases stopped getting a default workspace with the home screen
(#660), so the fixtures from #654 that took the first workspace panicked
on an empty list. They now create one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Gregory SchierandClaude Fable 5 committed 2026-09-15 14:50:05 -07:00
1 parent 621f9c3b8f
commit caeebebc75
2 files changed
+11 -3

No files matched your search

@@ -232,7 +232,11 @@ mod tests {
let source = &UpdateSource::Background;
let (base, staging, folder) = manager
.with_tx(|db| {
let workspace = db.list_workspaces()?.remove(0);
// Fresh databases no longer come with a workspace, so make one
let workspace = db.upsert_workspace(
&Workspace { name: "Test".into(), ..Default::default() },
source,
)?;
let variable = |name: &str, value: &str| EnvironmentVariable {
enabled: true,
name: name.into(),