]> BookStack Code Mirror - bookstack/blob - tests/Meta/HelpTest.php
Lexical: Added about button/view
[bookstack] / tests / Meta / HelpTest.php
1 <?php
2
3 namespace Tests\Meta;
4
5 use Tests\TestCase;
6
7 class HelpTest extends TestCase
8 {
9     public function test_tinymce_help_shows_tiny_and_tiny_license_link()
10     {
11         $resp = $this->get('/help/tinymce');
12         $resp->assertOk();
13         $this->withHtml($resp)->assertElementExists('a[href="https://www.tiny.cloud/"]');
14         $this->withHtml($resp)->assertElementExists('a[href="' . url('/libs/tinymce/license.txt') . '"]');
15     }
16
17     public function test_tiny_license_exists_where_expected()
18     {
19         $expectedPath = public_path('/libs/tinymce/license.txt');
20         $this->assertTrue(file_exists($expectedPath));
21
22         $contents = file_get_contents($expectedPath);
23         $this->assertStringContainsString('MIT License', $contents);
24     }
25
26     public function test_wysiwyg_help_shows_lexical_and_licenses_link()
27     {
28         $resp = $this->get('/help/wysiwyg');
29         $resp->assertOk();
30         $this->withHtml($resp)->assertElementExists('a[href="https://lexical.dev/"]');
31         $this->withHtml($resp)->assertElementExists('a[href="' . url('/licenses') . '"]');
32     }
33 }