Attempted to make test a bit less flaky

This commit is contained in:
Dan Brown 2021-11-13 14:51:59 +00:00
parent 755dc99c72
commit 21d3620ef0
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -18,20 +18,17 @@ class EntitySearchTest extends TestCase
$search = $this->asEditor()->get('/search?term=' . urlencode($page->name)); $search = $this->asEditor()->get('/search?term=' . urlencode($page->name));
$search->assertSee('Search Results'); $search->assertSee('Search Results');
$search->assertSeeText($page->name, true);
$title = strip_tags($search->getElementHtml('.entity-list-item-name'));
$this->assertEquals($page->name, $title);
} }
public function test_bookshelf_search() public function test_bookshelf_search()
{ {
/** @var Bookshelf $shelf */ /** @var Bookshelf $shelf */
$shelf = Bookshelf::query()->first(); $shelf = Bookshelf::query()->first();
$search = $this->asEditor()->get('/search?term=' . urlencode(mb_substr($shelf->name, 0, 3)) . ' {type:bookshelf}');
$search->assertStatus(200);
$title = strip_tags($search->getElementHtml('.entity-list-item-name')); $search = $this->asEditor()->get('/search?term=' . urlencode($shelf->name) . ' {type:bookshelf}');
$this->assertEquals($shelf->name, $title); $search->assertSee('Search Results');
$search->assertSeeText($shelf->name, true);
} }
public function test_invalid_page_search() public function test_invalid_page_search()