=feat-stitch-intelligence-cockpit

This commit is contained in:
Jens
2026-07-21 22:52:28 +02:00
parent 4505e47d36
commit 479f61fc6a
42 changed files with 754 additions and 857 deletions
@@ -66,6 +66,12 @@ def _assert_basic_html_accessibility(payload: bytes | str, *, page_name: str) ->
label = button.get_text(" ", strip=True) or button.get("aria-label")
assert label, f"{page_name}: knop zonder tekst of aria-label"
for element in soup.select("script[src], link[rel='stylesheet'][href]"):
asset_url = element.get("src") or element.get("href") or ""
assert not asset_url.startswith(("http://", "https://")), (
f"{page_name}: externe productie-asset gevonden: {asset_url}"
)
def _run_html_accessibility_probe(client, user, profile, job) -> None:
_seed_dashboard_score(profile=profile, job=job)
@@ -99,11 +105,16 @@ def _run_html_accessibility_probe(client, user, profile, job) -> None:
response = client.get(reverse("jobs:applications"))
assert response.status_code == 200
_assert_basic_html_accessibility(response.content, page_name="applications")
assert "Sollicitatiepipeline" in response.content.decode("utf-8")
response = client.get(reverse("sources:list"))
assert response.status_code == 200
_assert_basic_html_accessibility(response.content, page_name="sources")
response = client.get(reverse("dashboard:system"))
assert response.status_code == 200
_assert_basic_html_accessibility(response.content, page_name="system")
def _assert_playwright_accessibility(page, *, expected_h1: str) -> None:
page.wait_for_load_state("networkidle")
@@ -4,7 +4,7 @@ import pytest
from django.urls import reverse
from django.utils import timezone
from apps.jobs.models import Feedback, ScoreRun
from apps.jobs.models import Application, Feedback, ScoreRun
from apps.jobs.tasks import rescore_active_jobs, update_job_lifecycle
from apps.notifications.tasks import build_due_digests
from apps.sources.models import RawDocument, Source, SourceLease, SourcePolicyReview, SourceRun
@@ -163,7 +163,11 @@ def test_job_profile_source_and_application_views(client, user, profile, job, so
assert client.get(reverse("profiles:edit", kwargs={"pk": profile.pk})).status_code == 200
assert client.get(reverse("sources:list")).status_code == 200
assert client.get(reverse("dashboard:system")).status_code == 200
assert client.get(reverse("jobs:applications")).status_code == 200
applications_response = client.get(reverse("jobs:applications"))
assert applications_response.status_code == 200
assert [column["status"] for column in applications_response.context["pipeline_columns"]] == [
status for status, _label in Application.Status.choices
]
source.policy = Source.Policy.DENY
source.save(update_fields=["policy"])