Skip to content

Commit

Permalink
Make tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherSpelt committed Nov 25, 2024
1 parent d522b0d commit 8dc230a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 40 deletions.
3 changes: 3 additions & 0 deletions prod.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ POSTGRES_PASSWORD=changethis
# Database viewer
PGADMIN_DEFAULT_PASSWORD=changethis
PGADMIN_DEFAULT_EMAIL=[email protected]

OIDC_CLIENT_SECRET=uIeFiKFazNEIbpJ3wzj0lZLLSJXefeld
OIDC_CLIENT_ID=AMT
35 changes: 0 additions & 35 deletions tests/e2e/test_create_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,38 +50,3 @@ def test_e2e_create_algorithm_invalid(page: Page):
button.click()

expect(page.get_by_text("name: String should have at")).to_be_visible()


@pytest.mark.slow
def test_e2e_create_algorithm_with_tasks(page: Page):
page.goto("/algorithms/new")

page.fill("#name", "My new filled algorithm")

button = page.locator("#lifecycle-DATA_EXPLORATION_AND_PREPARATION")
button.click()

impact_assessment = page.get_by_label("AI Impact Assessment (AIIA)")

expect(impact_assessment).not_to_be_checked()

impact_assessment.check()

button = page.locator("#transparency_obligations-transparantieverplichtingen")
button.click()

button = page.locator("#open_source-open-source")
button.click()

button = page.locator("#systemic_risk-systeemrisico")
button.click()

button = page.locator("#button-new-algorithm-create")
button.click()

page.wait_for_timeout(10000)
expect(page.get_by_text("My new filled algorithm").first).to_be_visible()
card_1 = page.get_by_text("Geef een korte beschrijving van het beoogde AI-systeem")
expect(card_1).to_be_visible()
card_2 = page.get_by_text("Waarom is er voor de huidige techniek gekozen?")
expect(card_2).to_be_visible()
2 changes: 1 addition & 1 deletion tests/e2e/test_search_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_e2e_search_algorithms_with_group_by_lifecycle_view(page: Page) -> None:
timeout=3000,
) as _:
expect(page.get_by_title("Organizational Responsibilities", exact=True)).to_be_visible()
expect(page.get_by_text("122 results for 'Algorithm'", exact=True)).to_be_visible()
expect(page.get_by_text("121 results for 'Algorithm'", exact=True)).to_be_visible()


@pytest.mark.slow
Expand Down
4 changes: 0 additions & 4 deletions tests/services/test_algorithms_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from amt.schema.system_card import SystemCard
from amt.services.algorithms import AlgorithmsService
from amt.services.instruments import InstrumentsService
from amt.services.tasks import TasksService
from pytest_mock import MockFixture
from tests.constants import default_instrument

Expand All @@ -20,7 +19,6 @@ async def test_get_algorithm(mocker: MockFixture):
algorithm_lifecycle = "development"
algorithms_service = AlgorithmsService(
repository=mocker.AsyncMock(spec=AlgorithmsRepository),
task_service=mocker.AsyncMock(spec=TasksService),
instrument_service=mocker.AsyncMock(spec=InstrumentsService),
)
algorithms_service.repository.find_by_id.return_value = Algorithm( # type: ignore
Expand All @@ -46,7 +44,6 @@ async def test_create_algorithm(mocker: MockFixture):

algorithms_service = AlgorithmsService(
repository=mocker.AsyncMock(spec=AlgorithmsRepository),
task_service=mocker.AsyncMock(spec=TasksService),
instrument_service=mocker.AsyncMock(spec=InstrumentsService),
)
algorithms_service.repository.save.return_value = Algorithm( # type: ignore
Expand Down Expand Up @@ -93,7 +90,6 @@ async def test_create_algorithm_unknown_template_id(mocker: MockFixture):

algorithms_service = AlgorithmsService(
repository=mocker.AsyncMock(spec=AlgorithmsRepository),
task_service=mocker.AsyncMock(spec=TasksService),
instrument_service=mocker.AsyncMock(spec=InstrumentsService),
)

Expand Down

0 comments on commit 8dc230a

Please sign in to comment.