aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_transfers.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_transfers.py')
-rw-r--r--packages/meshbay-hub/tests/test_transfers.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/meshbay-hub/tests/test_transfers.py b/packages/meshbay-hub/tests/test_transfers.py
index 86d58cd..3316615 100644
--- a/packages/meshbay-hub/tests/test_transfers.py
+++ b/packages/meshbay-hub/tests/test_transfers.py
@@ -208,9 +208,17 @@ def test_the_colour_is_defined_for_that_mark():
# ── The file list ───────────────────────────────────────────────────────────
def test_a_folder_name_carries_no_trailing_slash():
- """The folder icon in the cell beside it already says what it is."""
+ """
+ The folder icon in the cell beside it already says what it is.
+
+ Anchored on `key=${full}`, which is the row that renders a directory. The
+ first `dir-row` in the file is the ".." row added later, whose only cell is
+ an ellipsis — slicing from there found no `${d}` and failed on a name it
+ had never looked at.
+ """
source = STATIC.joinpath("files-app.js").read_text(encoding="utf-8")
- row = source[source.index('class="file-row dir-row"'):]
- row = row[:row.index("</tr>")]
+ start = source.rindex("<tr", 0, source.index("key=${full}"))
+ row = source[start:source.index("</tr>", start)]
+ assert "dir-row" in row, "the anchor no longer lands on the directory row"
assert "${d}/" not in row, "the folder name is rendered with a trailing slash"
assert "${d}" in row