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.
19 lines
713 B
PHP
19 lines
713 B
PHP
<?php
|
|
|
|
it('loads the petition page with a form', function () {
|
|
$this->visit(BASE_URL . '/underskriftskampanje/medisinsk-cannabis-pa-resept/')
|
|
->assertPresent('input[name="firstname"]');
|
|
});
|
|
|
|
it('shows required form fields', function () {
|
|
$this->visit(BASE_URL . '/underskriftskampanje/medisinsk-cannabis-pa-resept/')
|
|
->assertPresent('input[name="firstname"]')
|
|
->assertPresent('input[name="email"]')
|
|
->assertPresent('button[type="submit"]');
|
|
});
|
|
|
|
it('does not submit empty form', function () {
|
|
$this->visit(BASE_URL . '/underskriftskampanje/medisinsk-cannabis-pa-resept/')
|
|
->press('button[type="submit"]')
|
|
->assertPresent('input[name="firstname"]');
|
|
});
|