Skip to main content

max / makenotwork

Assert the markers the renderers write, not the ones the templates had Three tests were still looking for classes that left with the templates that carried them. The features are all present; the markers moved. git-nav-links -> id="git-nav" 8cc7e639, nav template to widgets::git_nav git-annotations -> id="annotations" 8cc7e639, panel partial to the described screen class=site-header -> role="banner" 257af740, header markup to quasi_webview::chrome The header's class is now generated, so the test takes `role="banner"`, which is the renderer's own contract rather than a name that can be regenerated. One of these was worse than stale. `nobody_else_sees_it_on_the_same_page` asserts an anonymous reader is NOT served another user's annotations, and it searched for a class that no longer exists anywhere, so it passed whether or not the section leaked. It now looks for the region the page actually emits and still passes, so the privacy behaviour was never broken; the test had simply stopped checking it.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session
https://claude.ai/code/session_01MptwXZ8k65v19rFmdGAyki
Author: Max Johnson <me@maxj.phd> · 2026-09-03 03:55 UTC
Signed with PGP, not checked
Commit: 1e06a36ed62913991914cbb68e441469c48ec1e1
Parent: 33c59fa
3 files changed, +12 insertions, -9 deletions
@@ -437,7 +437,7 @@
437 437 assert!(html.starts_with("<!doctype html>"), "{path}: {html}");
438 438 assert!(html.contains("/static/style.css"), "{path} lost its sheets");
439 439 assert!(
440 - html.contains("class=\"site-header\""),
440 + html.contains("role=\"banner\""),
441 441 "{path} lost the site header"
442 442 );
443 443 assert!(
@@ -72,7 +72,7 @@
72 72 .await;
73 73 assert_eq!(page.status, 200);
74 74 assert!(
75 - page.text.contains("git-annotations"),
75 + page.text.contains("id=\"annotations\""),
76 76 "the private section is missing from the author's own view"
77 77 );
78 78 assert!(
@@ -84,7 +84,7 @@
84 84 // substring check while showing nothing.
85 85 let body_at = page
86 86 .text
87 - .find("git-annotations")
87 + .find("id=\"annotations\"")
88 88 .expect("the section is present");
89 89 let form_at = page
90 90 .text
@@ -133,7 +133,7 @@
133 133 "an anonymous request was served a private annotation"
134 134 );
135 135 assert!(
136 - !anon.text.contains("git-annotations"),
136 + !anon.text.contains("id=\"annotations\""),
137 137 "the private section is rendered for a viewer who has no account"
138 138 );
139 139 }
@@ -755,6 +755,9 @@
755 755 // ── Nav bar consistency ──
756 756
757 757 #[tokio::test]
758 + // `id="git-nav"` and not the old `git-nav-links` class: `8cc7e639` replaced
759 + // the nav template with the described `widgets::git_nav`, whose region id is
760 + // `git_nav::REGION`. The class went with the template; the nav did not.
758 761 async fn git_nav_bar_present_on_all_pages() {
759 762 let tmp = tempfile::TempDir::new().unwrap();
760 763 make_test_repo(tmp.path());
@@ -763,17 +766,17 @@
763 766 // Repo overview
764 767 let resp = h.client.get("/git/testowner/testrepo").await;
765 768 assert!(
766 - resp.text.contains("git-nav-links"),
769 + resp.text.contains("id=\"git-nav\""),
767 770 "Repo overview should have nav"
768 771 );
769 772
770 773 let resp = h.client.get("/git/testowner/testrepo/tree/main").await;
771 - assert!(resp.text.contains("git-nav-links"), "Tree should have nav");
774 + assert!(resp.text.contains("id=\"git-nav\""), "Tree should have nav");
772 775
773 776 // Subdirectory
774 777 let resp = h.client.get("/git/testowner/testrepo/tree/main/src").await;
775 778 assert!(
776 - resp.text.contains("git-nav-links"),
779 + resp.text.contains("id=\"git-nav\""),
777 780 "Subdirectory should have nav"
778 781 );
779 782
@@ -783,13 +786,13 @@
783 786 .get("/git/testowner/testrepo/tree/main/src/main.rs")
784 787 .await;
785 788 assert!(
786 - resp.text.contains("git-nav-links"),
789 + resp.text.contains("id=\"git-nav\""),
787 790 "File view should have nav"
788 791 );
789 792
790 793 let resp = h.client.get("/git/testowner/testrepo/commits/main").await;
791 794 assert!(
792 - resp.text.contains("git-nav-links"),
795 + resp.text.contains("id=\"git-nav\""),
793 796 "Commits should have nav"
794 797 );
795 798 }