✨ Story 5.6: feedback utilisateur
This commit is contained in:
19
tests/contact-submit.test.php
Normal file
19
tests/contact-submit.test.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
function assertTrue($cond, $msg) {
|
||||
if (!$cond) {
|
||||
fwrite(STDERR, $msg . PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
$content = file_get_contents(__DIR__ . '/../assets/js/contact-form.js');
|
||||
|
||||
assertTrue(strpos($content, 'class ContactFormSubmit') !== false, 'missing ContactFormSubmit');
|
||||
assertTrue(strpos($content, 'fetch(') !== false, 'missing fetch');
|
||||
assertTrue(strpos($content, 'submit-text') !== false, 'missing submit-text');
|
||||
assertTrue(strpos($content, 'submit-loading') !== false, 'missing submit-loading');
|
||||
assertTrue(strpos($content, 'setLoadingState') !== false, 'missing loading state');
|
||||
assertTrue(strpos($content, 'formSuccess') !== false, 'missing formSuccess dispatch');
|
||||
assertTrue(strpos($content, 'AppState.clearFormData') !== false, 'missing localStorage clear');
|
||||
|
||||
fwrite(STDOUT, "OK\n");
|
||||
Reference in New Issue
Block a user