Add browser and unit test suite with Pest + Playwright

Add comprehensive test coverage for core site features (content,
navigation, language, FAQ, news, petition, newsletter) using Pest
browser tests and unit tests for custom plugins. Includes test
infrastructure (Containerfile.test, compose.test.yaml), test
documentation, and test files covering petition form logic, CSV
handling, translation, date formatting, rate limiting, and map data
building.
This commit is contained in:
Ruben 2026-03-17 16:43:39 +01:00
parent 0b61643ec5
commit b8e6d2537d
20 changed files with 1331 additions and 33 deletions

View file

@ -0,0 +1,31 @@
<?php
it('news listing page loads', function () {
$this->visit(BASE_URL . '/nyheter')
->assertSourceHas('<main');
});
it('news listing shows article titles', function () {
$this->visit(BASE_URL . '/nyheter')
->assertSee('Banebrytende');
});
it('individual news article loads', function () {
$this->visit(BASE_URL . '/nyheter/2025-09-26-banebrytende-studie')
->assertSourceHas('<main');
});
it('individual news article shows content', function () {
$this->visit(BASE_URL . '/nyheter/2025-09-26-banebrytende-studie')
->assertSee('medisinsk cannabis');
});
it('news article about podcast loads', function () {
$this->visit(BASE_URL . '/nyheter/2026-03-08-podcast-paradigmepodden')
->assertSourceHas('<main');
});
it('returns 404 for non-existent news article', function () {
$this->visit(BASE_URL . '/nyheter/finnes-ikke')
->assertSourceHas('404');
});