feat: more work on UI cleanup
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -22,6 +22,8 @@ defmodule BDS.Desktop.AutomationTest do
|
||||
assert snapshot.window_title == "Blogging Desktop Server"
|
||||
assert snapshot.active_view == "posts"
|
||||
assert snapshot.sidebar_visible == true
|
||||
assert snapshot.assistant_visible == false
|
||||
assert snapshot.panel_visible == false
|
||||
assert snapshot.editor_title == "Dashboard"
|
||||
assert snapshot.activity_labels == [
|
||||
"Posts",
|
||||
@@ -43,6 +45,12 @@ defmodule BDS.Desktop.AutomationTest do
|
||||
snapshot = Automation.snapshot(session)
|
||||
assert snapshot.sidebar_visible == false
|
||||
|
||||
assert :ok = Automation.click(session, "[data-testid='toggle-assistant']")
|
||||
|
||||
snapshot = Automation.snapshot(session)
|
||||
assert snapshot.assistant_visible == true
|
||||
assert snapshot.panel_visible == false
|
||||
|
||||
screenshot_path = Path.join(screenshot_dir, "main-window.png")
|
||||
assert Automation.capture_screenshot(session, screenshot_path) == screenshot_path
|
||||
assert File.exists?(screenshot_path)
|
||||
|
||||
@@ -73,6 +73,13 @@ defmodule BDS.Desktop.ShellCommandsTest do
|
||||
assert wait_for_task(result.task_id, &(&1.status in [:completed, :failed])).status == :completed
|
||||
end
|
||||
|
||||
test "missing project schema returns a command error instead of raising" do
|
||||
BDS.Repo.query!("DROP TABLE projects", [])
|
||||
|
||||
assert {:error, %{message: message}} = ShellCommands.execute("open_in_browser")
|
||||
assert message =~ "Project database is not initialized"
|
||||
end
|
||||
|
||||
defp wait_for_task(task_id, matcher, timeout \\ 2_000)
|
||||
|
||||
defp wait_for_task(task_id, _matcher, timeout) when timeout <= 0 do
|
||||
|
||||
Reference in New Issue
Block a user