feat: added doc rendering

This commit is contained in:
2026-05-04 06:47:28 +02:00
parent 43a4610ce7
commit cb46b45cda
10 changed files with 635 additions and 9 deletions

View File

@@ -1035,6 +1035,42 @@ defmodule BDS.Desktop.ShellLiveTest do
assert html =~ ~s(class="tab active transient")
end
test "workbench session restore renders documentation tab content" do
{:ok, view, _html} = live_isolated(build_conn(), BDS.Desktop.ShellLive)
session_payload =
Workbench.new()
|> Workbench.open_tab(:documentation, "documentation", :pin)
|> Session.serialize()
_html = render_hook(view, "restore_workbench_session", %{"session" => session_payload})
assert has_element?(view, ".tab[data-tab-type='documentation'] .tab-title", "Documentation")
assert has_element?(view, "[data-testid='help-documentation']")
assert render(view) =~ "bDS2 User Guide"
end
test "workbench session restore renders api documentation tab content" do
{:ok, view, _html} = live_isolated(build_conn(), BDS.Desktop.ShellLive)
session_payload =
Workbench.new()
|> Workbench.open_tab(:api_documentation, "api_documentation", :pin)
|> Session.serialize()
_html = render_hook(view, "restore_workbench_session", %{"session" => session_payload})
assert has_element?(
view,
".tab[data-tab-type='api_documentation'] .tab-title",
"Api Documentation"
)
assert has_element?(view, "[data-testid='help-api-documentation']")
assert render(view) =~ "API Documentation"
assert render(view) =~ "local result = bds.posts.get"
end
test "workbench session restore rehydrates chat tab titles from stored conversations" do
assert {:ok, conversation} = AI.start_chat(%{title: "Editorial Plan"})

View File

@@ -169,6 +169,11 @@ defmodule BDS.DesktopTest do
assert_receive :quit_requested
end
test "desktop external links point at the bDS2 GitHub project and issue tracker" do
assert BDS.Desktop.ExternalLinks.github_url() == "https://github.com/rfc1437/bDS2"
assert BDS.Desktop.ExternalLinks.github_issues_url() == "https://github.com/rfc1437/bDS2/issues"
end
test "icon menu quit requests app-owned shutdown" do
previous_module = Application.get_env(:bds, :desktop_shutdown_module)
previous_pid = Application.get_env(:bds, :desktop_shutdown_test_pid)