+
+ public function test_search_suggestion_endpoint()
+ {
+ $this->entities->newPage(['name' => 'My suggestion page', 'html' => '<p>My supercool suggestion page</p>']);
+
+ // Test specific search
+ $resp = $this->asEditor()->get('/search/suggest?term="supercool+suggestion"');
+ $resp->assertSee('My suggestion page');
+ $resp->assertDontSee('My supercool suggestion page');
+ $resp->assertDontSee('No items available');
+ $this->withHtml($resp)->assertElementCount('a', 1);
+
+ // Test search limit
+ $resp = $this->asEditor()->get('/search/suggest?term=et');
+ $this->withHtml($resp)->assertElementCount('a', 5);
+
+ // Test empty state
+ $resp = $this->asEditor()->get('/search/suggest?term=spaghettisaurusrex');
+ $this->withHtml($resp)->assertElementCount('a', 0);
+ $resp->assertSee('No items available');
+ }