|
8 | 8 | from conftest import SITE_URL |
9 | 9 |
|
10 | 10 |
|
11 | | -class TestSidebarSections: |
12 | | - """Sidebar should show the wireframe's section names.""" |
| 11 | +class TestPerSectionSidebars: |
| 12 | + """Each section should show ONLY its own sidebar items (per-section sidebars).""" |
13 | 13 |
|
14 | | - def test_sidebar_shows_architecture_and_vocabularies(self, page): |
15 | | - page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded") |
| 14 | + def test_how_to_use_sidebar_only_shows_own_items(self, page): |
| 15 | + page.goto(f"{SITE_URL}/how-to-use.html", wait_until="domcontentloaded") |
16 | 16 | sidebar = page.locator(".sidebar-navigation") |
17 | | - assert sidebar.get_by_text("Architecture & Vocabularies").count() > 0 |
| 17 | + assert sidebar.get_by_text("Overview", exact=True).count() > 0 |
| 18 | + # Should NOT show items from other sections |
| 19 | + assert sidebar.get_by_text("Objectives", exact=True).count() == 0 |
| 20 | + assert sidebar.get_by_text("Vocabularies", exact=True).count() == 0 |
18 | 21 |
|
19 | | - def test_sidebar_does_not_show_old_information_architecture(self, page): |
| 22 | + def test_about_sidebar_only_shows_own_items(self, page): |
20 | 23 | page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded") |
21 | 24 | sidebar = page.locator(".sidebar-navigation") |
22 | | - assert sidebar.get_by_text("Information Architecture").count() == 0 |
| 25 | + assert sidebar.get_by_text("Objectives", exact=True).count() > 0 |
| 26 | + # Should NOT show items from other sections |
| 27 | + assert sidebar.get_by_text("Deep-Dive Analysis").count() == 0 |
| 28 | + assert sidebar.get_by_text("Vocabularies", exact=True).count() == 0 |
23 | 29 |
|
24 | | - def test_sidebar_shows_research_and_resources(self, page): |
25 | | - page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded") |
| 30 | + def test_architecture_sidebar_only_shows_own_items(self, page): |
| 31 | + page.goto(f"{SITE_URL}/design/index.html", wait_until="domcontentloaded") |
26 | 32 | sidebar = page.locator(".sidebar-navigation") |
27 | | - assert sidebar.get_by_text("Research & Resources").count() > 0 |
| 33 | + assert sidebar.get_by_text("Vocabularies", exact=True).count() > 0 |
| 34 | + # Should NOT show items from other sections |
| 35 | + assert sidebar.get_by_text("Objectives", exact=True).count() == 0 |
| 36 | + assert sidebar.get_by_text("Deep-Dive Analysis").count() == 0 |
28 | 37 |
|
29 | | - def test_sidebar_does_not_show_separate_published_research(self, page): |
30 | | - page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded") |
| 38 | + def test_research_sidebar_only_shows_own_items(self, page): |
| 39 | + page.goto(f"{SITE_URL}/pubs.html", wait_until="domcontentloaded") |
31 | 40 | sidebar = page.locator(".sidebar-navigation") |
32 | | - assert sidebar.get_by_text("Published Research", exact=True).count() == 0 |
| 41 | + assert sidebar.get_by_text("Publications & Conferences").count() > 0 |
| 42 | + # Should NOT show items from other sections |
| 43 | + assert sidebar.get_by_text("Objectives", exact=True).count() == 0 |
| 44 | + assert sidebar.get_by_text("Deep-Dive Analysis").count() == 0 |
33 | 45 |
|
34 | | - def test_sidebar_does_not_show_separate_resources(self, page): |
35 | | - page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded") |
| 46 | + def test_sidebar_does_not_show_old_information_architecture(self, page): |
| 47 | + page.goto(f"{SITE_URL}/design/index.html", wait_until="domcontentloaded") |
36 | 48 | sidebar = page.locator(".sidebar-navigation") |
37 | | - # "Resources" alone shouldn't appear as a section header |
38 | | - # (it's OK inside "Research & Resources") |
39 | | - sections = sidebar.locator(".sidebar-section .sidebar-section-header") |
40 | | - texts = [s.text_content().strip() for s in sections.all()] |
41 | | - assert "Resources" not in texts |
| 49 | + assert sidebar.get_by_text("Information Architecture").count() == 0 |
42 | 50 |
|
43 | 51 |
|
44 | 52 | class TestSidebarHowToUse: |
@@ -122,17 +130,17 @@ class TestSidebarResearchResources: |
122 | 130 | """Research & Resources should have 3 items matching wireframe.""" |
123 | 131 |
|
124 | 132 | def test_has_publications_and_conferences(self, page): |
125 | | - page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded") |
| 133 | + page.goto(f"{SITE_URL}/pubs.html", wait_until="domcontentloaded") |
126 | 134 | sidebar = page.locator(".sidebar-navigation") |
127 | 135 | assert sidebar.get_by_text("Publications & Conferences").count() > 0 |
128 | 136 |
|
129 | 137 | def test_has_zenodo_community(self, page): |
130 | | - page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded") |
| 138 | + page.goto(f"{SITE_URL}/pubs.html", wait_until="domcontentloaded") |
131 | 139 | sidebar = page.locator(".sidebar-navigation") |
132 | 140 | assert sidebar.get_by_text("Zenodo Community").count() > 0 |
133 | 141 |
|
134 | 142 | def test_has_github_repositories(self, page): |
135 | | - page.goto(f"{SITE_URL}/about.html", wait_until="domcontentloaded") |
| 143 | + page.goto(f"{SITE_URL}/pubs.html", wait_until="domcontentloaded") |
136 | 144 | sidebar = page.locator(".sidebar-navigation") |
137 | 145 | assert sidebar.get_by_text("Github Repositories").count() > 0 |
138 | 146 |
|
|
0 commit comments