mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-06 12:02:45 +03:00
Merge branch 'tinymce' into development
This commit is contained in:
25
tests/HelpTest.php
Normal file
25
tests/HelpTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Tests;
|
||||
|
||||
class HelpTest extends TestCase
|
||||
{
|
||||
|
||||
public function test_wysiwyg_help_shows_tiny_and_tiny_license_link()
|
||||
{
|
||||
$resp = $this->get('/help/wysiwyg');
|
||||
$resp->assertOk();
|
||||
$resp->assertElementExists('a[href="https://www.tiny.cloud/"]');
|
||||
$resp->assertElementExists('a[href="' . url('/libs/tinymce/license.txt') . '"]');
|
||||
}
|
||||
|
||||
public function test_tiny_license_exists_where_expected()
|
||||
{
|
||||
$expectedPath = public_path('/libs/tinymce/license.txt');
|
||||
$this->assertTrue(file_exists($expectedPath));
|
||||
|
||||
$contents = file_get_contents($expectedPath);
|
||||
$this->assertStringContainsString('GNU LESSER GENERAL PUBLIC LICENSE', $contents);
|
||||
}
|
||||
|
||||
}
|
@@ -14,6 +14,15 @@ class CustomHeadContentTest extends TestCase
|
||||
$resp->assertSee('console.log("cat")', false);
|
||||
}
|
||||
|
||||
public function test_content_wrapped_in_specific_html_comments()
|
||||
{
|
||||
// These comments are used to identify head content for editor injection
|
||||
$this->setSettings(['app-custom-head' => '<script>console.log("cat");</script>']);
|
||||
$resp = $this->get('/login');
|
||||
$resp->assertSee('<!-- Start: custom user content -->', false);
|
||||
$resp->assertSee('<!-- End: custom user content -->', false);
|
||||
}
|
||||
|
||||
public function test_configured_content_does_not_show_on_settings_page()
|
||||
{
|
||||
$this->setSettings(['app-custom-head' => '<script>console.log("cat");</script>']);
|
||||
|
Reference in New Issue
Block a user