X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/371033a0f21c2a2378aab53e1c7b8278feb0fb79..refs/pull/2734/head:/tests/Entity/ExportTest.php diff --git a/tests/Entity/ExportTest.php b/tests/Entity/ExportTest.php index 05672c6ca..d04ccc69a 100644 --- a/tests/Entity/ExportTest.php +++ b/tests/Entity/ExportTest.php @@ -1,5 +1,6 @@ assertSee('src="/uploads/svg_test.svg"'); } + public function test_exports_removes_scripts_from_custom_head() + { + $entities = [ + Page::query()->first(), Chapter::query()->first(), Book::query()->first(), + ]; + setting()->put('app-custom-head', ''); + + foreach ($entities as $entity) { + $resp = $this->asEditor()->get($entity->getUrl('/export/html')); + $resp->assertDontSee('window.donkey'); + $resp->assertDontSee('script'); + $resp->assertSee('.my-test-class { color: red; }'); + } + } + }