Skip to content

Commit

Permalink
Test pretty URLs are used on dashboard's index using content.html.twi…
Browse files Browse the repository at this point in the history
…g's menu items
  • Loading branch information
quentint committed Nov 4, 2024
1 parent 9e0ef39 commit 268e336
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/Controller/PrettyUrls/PrettyUrlsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ public function testDefaultWelcomePage()
$client = static::createClient();
$client->followRedirects();

$client->request('GET', '/admin/pretty/urls');
$crawler = $client->request('GET', '/admin/pretty/urls');

$this->assertResponseIsSuccessful();
$this->assertSelectorTextContains('h1', 'Welcome to EasyAdmin 4');

$this->assertSame('http://localhost/admin/pretty/urls/blog_post/', $crawler->filter('li.menu-item a:contains("Blog Posts")')->attr('href'));
$this->assertSame('http://localhost/admin/pretty/urls/category/', $crawler->filter('li.menu-item a:contains("Categories")')->attr('href'));
}

public function testCusomizedWelcomePage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DashboardController extends AbstractDashboardController
#[Route('/admin/pretty/urls', name: 'admin_pretty')]
public function index(): Response
{
return parent::index();
return $this->render('@EasyAdmin/page/content.html.twig');
}

public function configureDashboard(): Dashboard
Expand Down

0 comments on commit 268e336

Please sign in to comment.