✨ Story 5.7: liens contact secondaires
This commit is contained in:
23
tests/contact-links.test.php
Normal file
23
tests/contact-links.test.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
function assertTrue($cond, $msg) {
|
||||
if (!$cond) {
|
||||
fwrite(STDERR, $msg . PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
$content = file_get_contents(__DIR__ . '/../pages/contact.php');
|
||||
assertTrue(strpos($content, 'Retrouvez-moi aussi sur') !== false, 'missing section title');
|
||||
assertTrue(strpos($content, 'linkedin.com/in/') !== false, 'missing linkedin link');
|
||||
assertTrue(strpos($content, 'github.com/') !== false, 'missing github link');
|
||||
assertTrue(strpos($content, 'id="email-link"') !== false, 'missing email link');
|
||||
assertTrue(strpos($content, 'data-user=') !== false, 'missing data-user');
|
||||
assertTrue(strpos($content, 'data-domain=') !== false, 'missing data-domain');
|
||||
assertTrue(strpos($content, 'target="_blank"') !== false, 'missing target blank');
|
||||
assertTrue(strpos($content, 'rel="noopener') !== false, 'missing rel noopener');
|
||||
|
||||
$js = file_get_contents(__DIR__ . '/../assets/js/main.js');
|
||||
assertTrue(strpos($js, 'initEmailProtection') !== false, 'missing initEmailProtection');
|
||||
assertTrue(strpos($js, 'mailto:') !== false, 'missing mailto reconstruction');
|
||||
|
||||
fwrite(STDOUT, "OK\n");
|
||||
Reference in New Issue
Block a user