+
+ $pageView = $this->get($page->getUrl());
+ $pageView->assertSee('<h1>My Title</h1>', false);
+ }
+
+ public function test_html_cannot_be_injected_via_comment_content()
+ {
+ $this->asAdmin();
+ $page = Page::first();
+
+ $script = '<script>const a = "script";</script>\n\n# sometextinthecomment';
+ $this->postJson("/comment/$page->id", [
+ 'text' => $script,
+ ]);
+
+ $pageView = $this->get($page->getUrl());
+ $pageView->assertDontSee($script, false);
+ $pageView->assertSee('sometextinthecomment');
+
+ $comment = $page->comments()->first();
+ $this->putJson("/comment/$comment->id", [
+ 'text' => $script . 'updated',
+ ]);
+
+ $pageView = $this->get($page->getUrl());
+ $pageView->assertDontSee($script, false);
+ $pageView->assertSee('sometextinthecommentupdated');