diff --git a/web/olt/home.py b/web/olt/home.py index 424982f..a0493e1 100644 --- a/web/olt/home.py +++ b/web/olt/home.py @@ -605,6 +605,7 @@ def results(recs=None, *, finder=False, groups=None, routes_list=False, default_ """ elif saved: count = '

0 trails

' diff --git a/web/olt/layout.py b/web/olt/layout.py index 8371816..2f41d58 100644 --- a/web/olt/layout.py +++ b/web/olt/layout.py @@ -165,6 +165,8 @@ def footer(site):
  • Sources and their terms
  • Logos
  • Considered and left out
  • +
  • How trails are chosen
  • +
  • Changelog
  • {report} diff --git a/web/tests/test_left_out.py b/web/tests/test_left_out.py index b274141..30eaf38 100644 --- a/web/tests/test_left_out.py +++ b/web/tests/test_left_out.py @@ -11,7 +11,7 @@ WEB = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ROOT = os.path.dirname(WEB) sys.path.insert(0, WEB) -from olt import leftout, seo, site # noqa: E402 +from olt import home, layout, leftout, records, seo, site # noqa: E402 ENTRIES = [ { @@ -102,5 +102,26 @@ class PageTest(unittest.TestCase): self.assertTrue(reasons <= set(leftout.REASON_ORDER)) +class ReachTest(unittest.TestCase): + """The list is linked where a visitor who cannot find a trail would look.""" + + def test_the_empty_state_of_every_list_of_trails_links_to_it(self): + recs = records.load_records(ROOT) + for finder in (True,): + html = str(home.results(recs, finder=finder)) + empty = html[html.index('id="empty-state"'):] + empty = empty[:empty.index("")] + self.assertIn("Not finding a trail?", empty) + self.assertIn('Some are left out, with the reason for each.', empty) + # a list that is not driven by the filter bar has no empty state, so no link + self.assertNotIn("/left-out/", str(home.results(recs))) + + def test_the_footer_links_the_list_the_changelog_and_the_rules(self): + footer = str(layout.footer(site.Site("N", "T"))) + self.assertIn('Considered and left out', footer) + self.assertIn('Changelog', footer) + self.assertIn('How trails are chosen', footer) + + if __name__ == "__main__": unittest.main()