aboutsummaryrefslogtreecommitdiff
path: root/tests/views/test_received.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-18 17:41:44 +0100
committerDennis Fink2026-11-18 17:41:44 +0100
commite3e195ea07fd57288d32c842689ebed7fba636f0 (patch)
treeda4358930bfc6bd7c855a77de2898c19e7043a84 /tests/views/test_received.py
parent44ece87ed14c5d19bd6ceabfd023e45561b08ef3 (diff)
downloadwebmentions-ssg-e3e195ea07fd57288d32c842689ebed7fba636f0.tar.gz
webmentions-ssg-e3e195ea07fd57288d32c842689ebed7fba636f0.zip
style(core): improve mobile table layouts
Hide secondary received and sent table columns below the `md` breakpoint while keeping status, primary identifiers, details, and actions accessible. Add responsive wrappers, mobile received timestamps, and wrapping for long paths and URLs to improve small-screen readability.
Diffstat (limited to '')
-rw-r--r--tests/views/test_received.py51
1 files changed, 30 insertions, 21 deletions
diff --git a/tests/views/test_received.py b/tests/views/test_received.py
index 5ae42f7..1a291ae 100644
--- a/tests/views/test_received.py
+++ b/tests/views/test_received.py
@@ -56,6 +56,32 @@ def test_received_lists_webmentions(app: Flask, client: FlaskClient) -> None:
assert TARGET_URL in html
+def test_received_table_hides_secondary_columns_on_mobile(
+ app: Flask, client: FlaskClient
+) -> None:
+ log_in(app, client)
+ create_received_webmention(app)
+
+ response = client.get("/received")
+
+ assert response.status_code == HTTPStatus.OK
+ html = BeautifulSoup(response.get_data(as_text=True), "html.parser")
+ table = html.select_one(".table-responsive > table")
+ assert table is not None
+ headers = table.select("thead th")
+ cells = table.select("tbody tr:first-child td")
+ assert len(headers) == len(cells) == 7
+ for index in (0, 3, 4, 5): # Select, target, received, updated
+ for cell in (headers[index], cells[index]):
+ assert {"d-none", "d-md-table-cell"} <= set(cell.get("class", []))
+ for index in (1, 2, 6): # Status, source, details stay visible
+ assert "d-none" not in cells[index].get("class", [])
+ assert cells[2].select_one(".d-md-none time") is not None
+ assert "text-break" in cells[2].get("class", [])
+ for button in html.select("[data-received-bulk-action]"):
+ assert {"d-none", "d-md-inline-block"} <= set(button.get("class", []))
+
+
@pytest.mark.parametrize(
("filter_status", "expected_statuses"),
[
@@ -1125,31 +1151,15 @@ def test_received_detail_shows_full_reason_timestamps_and_public_status(
@pytest.mark.parametrize(
("reason", "explanation", "next_step"),
[
- (
- "Source does not mention target",
- "does not contain a recognized link",
- None,
- ),
- (
- "Source returned HTTP 404",
- "source page was not found",
- None,
- ),
- (
- "Source returned HTTP 503",
- "source server returned a server error",
- None,
- ),
+ ("Source does not mention target", "does not contain a recognized link", None),
+ ("Source returned HTTP 404", "source page was not found", None),
+ ("Source returned HTTP 503", "source server returned a server error", None),
(
"Source hostname could not be resolved",
"could not be resolved through DNS",
None,
),
- (
- "Source document is too large",
- "configured maximum response size",
- None,
- ),
+ ("Source document is too large", "configured maximum response size", None),
(
"Source domain is blocked",
"receiver's blocklist",
@@ -1197,7 +1207,6 @@ def test_received_detail_only_suggests_receiver_controlled_steps(
assert reason in details.get_text()
-
def test_received_detail_explains_historical_failure_and_escapes_raw_text(
app: Flask, client: FlaskClient
) -> None: