aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_desktop_shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_desktop_shell.py')
-rw-r--r--packages/meshbay-hub/tests/test_desktop_shell.py32
1 files changed, 27 insertions, 5 deletions
diff --git a/packages/meshbay-hub/tests/test_desktop_shell.py b/packages/meshbay-hub/tests/test_desktop_shell.py
index 4426dd7..e80933c 100644
--- a/packages/meshbay-hub/tests/test_desktop_shell.py
+++ b/packages/meshbay-hub/tests/test_desktop_shell.py
@@ -425,12 +425,11 @@ def test_the_page_names_node_operations_not_routes():
assert defined <= used, f"defined but never called: {defined - used}"
-@pytest.mark.parametrize("op", ["attachGroup", "addRoot", "initGek", "clearDenylist"])
+@pytest.mark.parametrize("op", ["attachGroup", "addRoot", "clearDenylist"])
def test_what_widens_the_node_is_confirmed_natively(op):
- """Sharing a folder, hosting a group, replacing the key, re-admitting a
- revoked subject: asked by a dialog the main process draws, which a script in
- the page cannot answer. A folder chosen in the native picker is its own
- confirmation."""
+ """Sharing a folder, hosting a group, re-admitting a revoked subject: asked
+ by a dialog the main process draws, which a script in the page cannot
+ answer. A folder chosen in the native picker is its own confirmation."""
body = _node_ops()[op]
assert "confirmOrRefuse(" in body or "confirmFolder(" in body
@@ -701,3 +700,26 @@ def test_an_account_made_in_the_application_starts_without_browser_access():
assert "platform.keys.createdHere(reg.userId)" in register
assert "userId" in (STATIC / "keyderive.js").read_text(encoding="utf-8").split(
"async function registerUser", 1)[1].split("\n}\n", 1)[0]
+
+
+def _handler(name: str) -> str:
+ source = _main()
+ start = source.index(f"handle('{name}'")
+ return source[start:source.index("\n });", start)]
+
+
+def test_a_finished_download_carries_the_mark_of_the_web():
+ """What a browser leaves on every download, so Windows applies SmartScreen
+ and Protected View. Only checkable here by reading: the stream exists on
+ NTFS alone, and this suite does not run on Windows."""
+ assert "markFromInternet(sink.path)" in _handler("save:end")
+ source = _main()
+ mark = source[source.index("function markFromInternet"):]
+ mark = mark[:mark.index("\n }\n")]
+ assert "Zone.Identifier" in mark and "ZoneId=3" in mark
+ assert "process.platform !== 'win32'" in mark
+
+
+def test_a_saved_name_cannot_hide_its_extension():
+ begin = _handler("save:begin")
+ assert "\\u202a-\\u202e" in begin and "\\u2066-\\u2069" in begin