Skip to content

Commit

Permalink
add tests for angle brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
mozex committed Jun 28, 2024
1 parent 15a4030 commit ac1ad70
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Feature/RoutesExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,19 @@
expect(trim($converter->convert("[Home](route('home', absolute: false))")->getContent()))
->toBe('<p><a href="/">Home</a></p>');
});

it('replaces route with angle brackets', function () {
$converter = new CommonMarkConverter();
$converter->getEnvironment()->addExtension(new RoutesExtension());

expect(trim($converter->convert("[Home](<route('home')>)")->getContent()))
->toBe('<p><a href="http://localhost">Home</a></p>');
});

it('replaces route with angle brackets and named arguments', function () {
$converter = new CommonMarkConverter();
$converter->getEnvironment()->addExtension(new RoutesExtension());

expect(trim($converter->convert("[Home](<route('home', absolute: false)>)")->getContent()))
->toBe('<p><a href="/">Home</a></p>');
});

0 comments on commit ac1ad70

Please sign in to comment.