mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-02-24 21:39:41 +08:00

Some checks failed
test-php / build (8.1) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
test-php / build (8.4) (push) Has been cancelled
analyse-php / build (push) Has been cancelled
lint-js / build (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-js / build (push) Has been cancelled
test-migrations / build (8.1) (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-migrations / build (8.4) (push) Has been cancelled
Re-used existing route and moved tinymce help to its own different route. Added test to cover. Added new external-content block to support in editor UI.
34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Tests\Meta;
|
|
|
|
use Tests\TestCase;
|
|
|
|
class HelpTest extends TestCase
|
|
{
|
|
public function test_tinymce_help_shows_tiny_and_tiny_license_link()
|
|
{
|
|
$resp = $this->get('/help/tinymce');
|
|
$resp->assertOk();
|
|
$this->withHtml($resp)->assertElementExists('a[href="https://www.tiny.cloud/"]');
|
|
$this->withHtml($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('MIT License', $contents);
|
|
}
|
|
|
|
public function test_wysiwyg_help_shows_lexical_and_licenses_link()
|
|
{
|
|
$resp = $this->get('/help/wysiwyg');
|
|
$resp->assertOk();
|
|
$this->withHtml($resp)->assertElementExists('a[href="https://lexical.dev/"]');
|
|
$this->withHtml($resp)->assertElementExists('a[href="' . url('/licenses') . '"]');
|
|
}
|
|
}
|