mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Input WYSIWYG: Fixed existing tests, fixed empty description handling
This commit is contained in:
@@ -52,7 +52,7 @@ class SearchApiTest extends TestCase
|
||||
public function test_all_endpoint_returns_items_with_preview_html()
|
||||
{
|
||||
$book = $this->entities->book();
|
||||
$book->update(['name' => 'name with superuniquevalue within', 'description' => 'Description with superuniquevalue within']);
|
||||
$book->forceFill(['name' => 'name with superuniquevalue within', 'description' => 'Description with superuniquevalue within'])->save();
|
||||
$book->indexForSearch();
|
||||
|
||||
$resp = $this->actingAsApiAdmin()->getJson($this->baseEndpoint . '?query=superuniquevalue');
|
||||
|
@@ -307,6 +307,8 @@ class BookTest extends TestCase
|
||||
|
||||
$resp->assertRedirect($copy->getUrl());
|
||||
$this->assertEquals($book->getDirectChildren()->count(), $copy->getDirectChildren()->count());
|
||||
|
||||
$this->get($copy->getUrl())->assertSee($book->description_html, false);
|
||||
}
|
||||
|
||||
public function test_copy_does_not_copy_non_visible_content()
|
||||
|
@@ -42,6 +42,7 @@ class ConvertTest extends TestCase
|
||||
$this->assertEquals('Penguins', $newBook->tags->first()->value);
|
||||
$this->assertEquals($chapter->name, $newBook->name);
|
||||
$this->assertEquals($chapter->description, $newBook->description);
|
||||
$this->assertEquals($chapter->description_html, $newBook->description_html);
|
||||
|
||||
$this->assertActivityExists(ActivityType::BOOK_CREATE_FROM_CHAPTER, $newBook);
|
||||
}
|
||||
@@ -105,6 +106,7 @@ class ConvertTest extends TestCase
|
||||
$this->assertEquals('Ducks', $newShelf->tags->first()->value);
|
||||
$this->assertEquals($book->name, $newShelf->name);
|
||||
$this->assertEquals($book->description, $newShelf->description);
|
||||
$this->assertEquals($book->description_html, $newShelf->description_html);
|
||||
$this->assertEquals($newShelf->books()->count(), $bookChapterCount + 1);
|
||||
$this->assertEquals($systemBookCount + $bookChapterCount, Book::query()->count());
|
||||
$this->assertActivityExists(ActivityType::BOOKSHELF_CREATE_FROM_BOOK, $newShelf);
|
||||
|
@@ -102,13 +102,13 @@ class ReferencesTest extends TestCase
|
||||
|
||||
foreach ($entities as $entity) {
|
||||
$resp = $this->get($entity->getUrl());
|
||||
$resp->assertSee('Referenced on 1 page');
|
||||
$resp->assertDontSee('Referenced on 1 pages');
|
||||
$resp->assertSee('Referenced by 1 item');
|
||||
$resp->assertDontSee('Referenced by 1 items');
|
||||
}
|
||||
|
||||
$this->createReference($otherPage, $entities['page']);
|
||||
$resp = $this->get($entities['page']->getUrl());
|
||||
$resp->assertSee('Referenced on 2 pages');
|
||||
$resp->assertSee('Referenced by 2 items');
|
||||
}
|
||||
|
||||
public function test_references_to_visible_on_references_page()
|
||||
|
@@ -21,7 +21,7 @@ class RegenerateReferencesTest extends TestCase
|
||||
public function test_action_runs_reference_regen()
|
||||
{
|
||||
$this->mock(ReferenceStore::class)
|
||||
->shouldReceive('updateForAllPages')
|
||||
->shouldReceive('updateForAll')
|
||||
->once();
|
||||
|
||||
$resp = $this->asAdmin()->post('/settings/maintenance/regenerate-references');
|
||||
@@ -45,7 +45,7 @@ class RegenerateReferencesTest extends TestCase
|
||||
public function test_action_failed_shown_as_error_notification()
|
||||
{
|
||||
$this->mock(ReferenceStore::class)
|
||||
->shouldReceive('updateForAllPages')
|
||||
->shouldReceive('updateForAll')
|
||||
->andThrow(\Exception::class, 'A badger stopped the task');
|
||||
|
||||
$resp = $this->asAdmin()->post('/settings/maintenance/regenerate-references');
|
||||
|
Reference in New Issue
Block a user