feat: base app now working better
This commit is contained in:
@@ -124,4 +124,19 @@ defmodule BDS.UI.ShellTest do
|
||||
assert js =~ "activity-bar-top"
|
||||
assert js =~ "activity-bar-bottom"
|
||||
end
|
||||
|
||||
test "static shell bundle hides the fake titlebar menu on macOS and keeps old status-bar alignment rules" do
|
||||
css = File.read!("/Users/gb/Projects/bDS2/priv/ui/app.css")
|
||||
js = File.read!("/Users/gb/Projects/bDS2/priv/ui/app.js")
|
||||
|
||||
assert js =~ "navigator.platform"
|
||||
assert js =~ "isMac"
|
||||
assert js =~ "window-titlebar-menu-bar is-hidden"
|
||||
|
||||
assert css =~ ".window-titlebar-menu-bar.is-hidden"
|
||||
assert css =~ ".status-bar-left,"
|
||||
assert css =~ "gap: 4px"
|
||||
assert css =~ "padding: 0 8px"
|
||||
assert css =~ "height: 100%"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -161,20 +161,28 @@ defmodule BDS.UI.WorkbenchTest do
|
||||
test "menu commands expose generic shell controls through a shared command model" do
|
||||
state = Workbench.new(sidebar_visible: false, panel_visible: false)
|
||||
groups = MenuBar.default_groups(dev_mode?: false)
|
||||
item_ids = fn items ->
|
||||
items
|
||||
|> Enum.reject(&Map.get(&1, :separator, false))
|
||||
|> Enum.map(& &1.id)
|
||||
end
|
||||
|
||||
assert Enum.map(groups, & &1.id) == [:app, :file, :edit, :view, :window, :help]
|
||||
assert Enum.map(groups, & &1.id) == [:file, :edit, :view, :blog, :help]
|
||||
|
||||
view_group = Enum.find(groups, &(&1.id == :view))
|
||||
command_ids = Enum.map(view_group.items, & &1.id)
|
||||
command_ids = item_ids.(view_group.items)
|
||||
|
||||
assert :toggle_sidebar in command_ids
|
||||
assert :toggle_panel in command_ids
|
||||
refute :toggle_dev_tools in command_ids
|
||||
|
||||
blog_group = Enum.find(groups, &(&1.id == :blog))
|
||||
assert :metadata_diff in item_ids.(blog_group.items)
|
||||
|
||||
state = MenuBar.execute(state, :toggle_sidebar)
|
||||
state = MenuBar.execute(state, :toggle_panel)
|
||||
|
||||
assert state.sidebar_visible == true
|
||||
assert state.panel.visible == true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user