|
|
| import pathlib |
| ROOT=pathlib.Path(__file__).resolve().parents[1] |
|
|
| def test_version_375(): |
| assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.3.0" |
|
|
| def test_sidebar_order_and_groups(): |
| html=(ROOT/"app.html").read_text(encoding="utf-8") |
| order=[ |
| 'data-view="chat"', |
| 'data-view="projectPackage"', |
| 'data-view="datasets"', |
| 'data-view="tasks"', |
| 'data-view="favorites"', |
| 'data-view="services"', |
| 'data-view="dataHealth"', |
| 'data-view="settings"', |
| ] |
| positions=[html.index(x) for x in order] |
| assert positions==sorted(positions) |
| assert 'class="nav primary-tools"' in html |
| assert 'class="nav sidebar-tools secondary-tools"' in html |
|
|
| def test_primary_tools_are_outside_collapsible_area(): |
| html=(ROOT/"app.html").read_text(encoding="utf-8") |
| primary=html[html.index('<nav class="nav primary-tools">'):html.index('</nav>', html.index('<nav class="nav primary-tools">'))] |
| secondary=html[html.index('<nav id="sidebarTools"'):html.index('</nav>', html.index('<nav id="sidebarTools"'))] |
| for view in ("chat","projectPackage","datasets","tasks"): |
| assert f'data-view="{view}"' in primary |
| assert f'data-view="{view}"' not in secondary |
| for view in ("favorites","services","dataHealth","settings"): |
| assert f'data-view="{view}"' in secondary |
|
|
| def test_collapse_copy_mentions_more_tools(): |
| html=(ROOT/"app.html").read_text(encoding="utf-8") |
| js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8") |
| assert "鏇村鍔熻兘" in html |
| assert "灞曞紑鏇村鍔熻兘" in js |
| assert "鎶樺彔鏇村鍔熻兘" in js |
|
|