| 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 |
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 |
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 |
|
}
|