mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-22 07:13:55 +02:00
Create multi page layout (#147)
Created two pages (home and company), page reloads after company selection in dropdown or clicking the home button.
This commit is contained in:
33
tests/ui/app_test.py
Normal file
33
tests/ui/app_test.py
Normal file
@ -0,0 +1,33 @@
|
||||
"""Test for the main app dashboard."""
|
||||
from collections.abc import Generator
|
||||
|
||||
import pytest
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from aki_prj23_transparenzregister.ui import app
|
||||
from aki_prj23_transparenzregister.ui.session_handler import SessionHandler
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _set_session(full_db: Session) -> Generator[None, None, None]:
|
||||
"""Sets a session for the dash application to be used."""
|
||||
SessionHandler.session = full_db
|
||||
yield
|
||||
SessionHandler.session = None
|
||||
|
||||
|
||||
def test_import() -> None:
|
||||
"""Checks if an import of the dash app can be made."""
|
||||
assert app is not None
|
||||
|
||||
|
||||
def test_go_to_home() -> None:
|
||||
"""Checks if the go_to_home callback yields a result."""
|
||||
output = app.go_to_home(1)
|
||||
assert output == "/"
|
||||
|
||||
|
||||
def test_go_to_company_page() -> None:
|
||||
"""Checks if the go_to_company_page callback yields a result."""
|
||||
output = app.go_to_company_page(1)
|
||||
assert output == "/Unternehmensdetails/1"
|
Reference in New Issue
Block a user