Last active
July 4, 2019 18:15
-
-
Save undertext/034f25bc6e5897df0a6d13bcdf95010b to your computer and use it in GitHub Desktop.
UrbanDefinitionListBlockJavascriptTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\tests\urban_module\FunctionalJavascript; | |
use Drupal\FunctionalJavascriptTests\WebDriverTestBase; | |
/** | |
* Tests urban definition list block (including JS functionality). | |
*/ | |
class UrbanDefinitionListBlockJavascriptTest extends WebDriverTestBase { | |
protected $profile = 'urban_profile'; | |
/** | |
* Tests that block is correctly displayed on the frontpage. | |
*/ | |
public function testBlock() { | |
$this->createNode([ | |
'type' => 'urban_definition', | |
'title' => 'brb', | |
]); | |
$this->createNode([ | |
'type' => 'urban_definition', | |
'title' => 'LMK', | |
]); | |
$this->drupalGet('<front>'); | |
$assertSession = $this->assertSession(); | |
$assertSession->pageTextContains('brb'); | |
$assertSession->pageTextContains('LMK'); | |
$assertSession->pageTextNotContains('Acronym for "be right back"'); | |
$assertSession->pageTextNotContains('Let me know'); | |
$this->click('a[href="/urban/definition/1"]'); | |
$assertSession->assertWaitOnAjaxRequest(); | |
$assertSession->pageTextContains('Acronym for "be right back"'); | |
$this->click('a[href="/urban/definition/2"]'); | |
$assertSession->assertWaitOnAjaxRequest(); | |
$assertSession->pageTextContains('Let me know'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment