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

26
tests/Browser/FaqTest.php Normal file
View file

@ -0,0 +1,26 @@
<?php
it('FAQ listing page loads', function () {
$this->visit(BASE_URL . '/faq')
->assertSee('Ofte stilte spørsmål');
});
it('FAQ listing shows question items', function () {
$this->visit(BASE_URL . '/faq')
->assertSee('medisinsk cannabis');
});
it('individual FAQ article loads', function () {
$this->visit(BASE_URL . '/faq/Hva-er-MC')
->assertSourceHas('<main');
});
it('individual FAQ article shows content', function () {
$this->visit(BASE_URL . '/faq/Hva-er-MC')
->assertSee('medisinsk cannabis');
});
it('FAQ article about driving license loads', function () {
$this->visit(BASE_URL . '/faq/forerkort')
->assertSourceHas('<main');
});