Skip to content

Commit

Permalink
Unit test for UUID links in the writer field
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbestle committed Nov 6, 2023
1 parent d4d0d22 commit 17fcb4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/Form/Fields/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public function setUp(): void
$this->app = new App([
'roots' => [
'index' => $this->tmp
],
'urls' => [
'index' => 'https://getkirby.com/subfolder'
]
]);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Form/Fields/WriterFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public function testDefaultProps()
public function testValueSanitized()
{
$field = $this->field('writer', [
'value' => 'This is a <strong>test</strong><script>alert("Hacked")</script> with <em>formatting</em>'
'value' => 'This is a <strong>test</strong><script>alert("Hacked")</script> with <em>formatting</em> and a <a href="/@/page/abcde">UUID link</a>'
]);

$this->assertSame('This is a <strong>test</strong> with <em>formatting</em>', $field->value());
$this->assertSame('This is a <strong>test</strong> with <em>formatting</em> and a <a href="/@/page/abcde">UUID link</a>', $field->value());
}

public function testValueTrimmed()
Expand Down

0 comments on commit 17fcb4f

Please sign in to comment.