Skip to content

Commit

Permalink
SQ -> Entity Tree: Select newly created root URL or group if selectio…
Browse files Browse the repository at this point in the history
…n was empty
  • Loading branch information
davidfstr committed Aug 28, 2024
1 parent 28facc0 commit 451bf01
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/crystal/tests/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
NewGroupDialog, NewRootUrlDialog, EntityTree,
MainWindow, OpenOrCreateDialog, PreferencesDialog,
)
from crystal.util.xos import is_windows
import datetime
import re
import tempfile
Expand Down Expand Up @@ -317,17 +318,21 @@ async def test_can_download_and_serve_a_static_site() -> None:
root_ti = TreeItem.GetRootItem(mw.entity_tree.window)
assert root_ti is not None

feed_group_ti = root_ti.find_child(feed_pattern)

# 1. Test cannot add new root resource in read-only project
# 2. Test cannot add new resource group in read-only project
selected_ti = TreeItem.GetSelection(mw.entity_tree.window)
assert (selected_ti is None) or (selected_ti == root_ti)
if is_windows():
# Windows will initialize the selection to the first child of the root
assert selected_ti == feed_group_ti
else:
assert (selected_ti is None) or (selected_ti == root_ti)
assert False == mw.new_root_url_button.IsEnabled()
assert False == mw.new_group_button.IsEnabled()

# Test cannot download/forget existing resource in read-only project
if True:
feed_group_ti = root_ti.find_child(feed_pattern)

feed_group_ti.Expand()
await wait_for(first_child_of_tree_item_is_not_loading_condition(feed_group_ti))

Expand Down

0 comments on commit 451bf01

Please sign in to comment.