Add only post node test

This commit is contained in:
Oliver Davies 2024-01-17 11:00:22 +00:00
parent 7714b20d3c
commit 3eb71026c1

View file

@ -58,4 +58,21 @@ class BlogPageTest extends BrowserTestBase {
$assert->pageTextContains('Post three');
}
public function testOnlyPostNodesAreShown(): void {
PostBuilder::create()->setTitle('Post one')->getPost();
PostBuilder::create()->setTitle('Post two')->getPost();
$this->createNode([
'title' => 'This is not a post',
'type' => 'page',
]);
$this->drupalGet('/blog');
$assert = $this->assertSession();
$assert->pageTextContains('Post one');
$assert->pageTextContains('Post two');
$assert->pageTextNotContains('This is not a post');
}
}