Compare commits

..

3 commits

Author SHA1 Message Date
a84296ae29 Merge pull request '55 - Add browser test for registration' (#62) from 55-add-browser-test-for-registration into release/v0.9.0
Some checks failed
CI / ci-image (push) Failing after 3m52s
CI / ci (push) Has been skipped
Reviewed-on: #62
2026-08-21 00:10:56 +02:00
7b14aa240c Merge branch 'release/v0.9.0' into 55-add-browser-test-for-registration
All checks were successful
CI / ci-image (pull_request) Successful in 1m1s
CI / ci (pull_request) Successful in 9m53s
2026-08-20 23:44:34 +02:00
b048aca93b 55 - Add browser test for registration
All checks were successful
CI / ci-image (pull_request) Successful in 55s
CI / ci (pull_request) Successful in 2m10s
2026-08-20 23:36:30 +02:00

View file

@ -0,0 +1,49 @@
<?php
it('registers successfully', function () {
visit('/register')
->type('input[id="name"]', 'Test User')
->type('input[id="email"]', 'new@example.com')
->type('input[id="password"]', 'password123')
->type('input[id="password_confirmation"]', 'password123')
->press('Register')
->assertPathIs('/dashboard')
->assertSee('Test User');
});
it('requires all registration fields', function () {
visit('/register')
->assertScript("document.querySelector('input[id=\"name\"]').required")
->assertScript("document.querySelector('input[id=\"email\"]').required")
->assertScript("document.querySelector('input[id=\"password\"]').required")
->assertScript("document.querySelector('input[id=\"password_confirmation\"]').required")
->assertAttribute('input[id="email"]', 'type', 'email')
->assertAttribute('input[id="password"]', 'type', 'password')
->assertAttribute('input[id="password_confirmation"]', 'type', 'password')
->press('Register')
->assertPathIs('/register');
});
it('rejects a mismatched password confirmation', function () {
visit('/register')
->type('input[id="name"]', 'Test User')
->type('input[id="email"]', 'new@example.com')
->type('input[id="password"]', 'password123')
->type('input[id="password_confirmation"]', 'different123')
->press('Register')
->assertPathIs('/register')
->assertSee('confirmation does not match');
});
it('rejects a duplicate email', function () {
createPlanner('taken@example.com');
visit('/register')
->type('input[id="name"]', 'Test User')
->type('input[id="email"]', 'taken@example.com')
->type('input[id="password"]', 'password123')
->type('input[id="password_confirmation"]', 'password123')
->press('Register')
->assertPathIs('/register')
->assertSee('has already been taken');
});