You are here

protected function NodeVoteTrait::unVoteFivestarById in Rate 8

Same name and namespace in other branches
  1. 8.2 tests/src/Traits/NodeVoteTrait.php \Drupal\Tests\rate\Traits\NodeVoteTrait::unVoteFivestarById()

Un-vote "Fivestar" by node id.

Parameters

int $nid: The node id.

1 call to NodeVoteTrait::unVoteFivestarById()
ViewsFivestarWidgetTest::testFivestarViewsWidget in tests/src/FunctionalJavascript/ViewsFivestarWidgetTest.php
Tests a fivestar views widget.

File

tests/src/Traits/NodeVoteTrait.php, line 33

Class

NodeVoteTrait
Provides methods to voting on nodes.

Namespace

Drupal\Tests\rate\Traits

Code

protected function unVoteFivestarById($nid) {
  $this
    ->assertSession()
    ->elementExists('css', '.rate-fivestar-1');
  $node_selector = '[data-drupal-selector="rate-node-' . $nid . '"]';
  $this
    ->click($node_selector . ' .rate-undo');
}