You are here

public function VueRenderTest::testExample1Renders in Decoupled Blocks: Vue.js 8

Test that a Vue instance renders.

File

tests/src/FunctionalJavascript/VueRenderTest.php, line 31

Class

VueRenderTest
Vue Render tests.

Namespace

Drupal\Tests\pdb_vue\FunctionalJavascript

Code

public function testExample1Renders() {
  $assert = $this
    ->assertSession();
  $config = $this
    ->config('pdb_vue.settings');

  // Set the values the user submitted in the form.
  $config
    ->set('version', 'vue2');
  $config
    ->set('development_mode', TRUE);
  $config
    ->save();

  // Place the "Vue Example 1" block.
  $this
    ->drupalPlaceBlock('vue_component:vue_example_1');
  $this
    ->drupalGet('<front>');
  $assert
    ->waitForElement('css', '.test');
  $assert
    ->pageTextContains("Hello Vue");
}