2c2 < index 45c2c66..1631746 100755 --- > index 45c2c66..0b7c3d3 100755 10c10 < + $compare_revision_submit = array( --- > + $compare_revision_submit = [ 14,15c14,15 < + '#attributes' => array( < + 'class' => array( --- > + '#attributes' => [ > + 'class' => [ 17,19c17,19 < + ), < + ), < + ); --- > + ], > + ], > + ]; 24c24 < + $build['submit_top'][] = $compare_revision_submit; --- > + $build['submit_top'] = $compare_revision_submit; 44c44 < + $build['submit_bottom'][] = $compare_revision_submit; --- > + $build['submit_bottom'] = $compare_revision_submit; 47a48,130 > diff --git a/tests/src/Functional/DiffRevisionTest.php b/tests/src/Functional/DiffRevisionTest.php > index b961833..b89cae4 100644 > --- a/tests/src/Functional/DiffRevisionTest.php > +++ b/tests/src/Functional/DiffRevisionTest.php > @@ -77,6 +77,10 @@ class DiffRevisionTest extends DiffTestBase { > // Assert the revision summary. > $this->assertSession()->pageTextContainsOnce('Revision 2 comment'); > > + // Assert the submit button. > + $this->assertSession()->elementExists('xpath','//input[@type="submit" and @id="edit-submit-bottom" and @value="Compare selected revisions"]'); > + $this->assertSession()->elementNotExists('xpath','//input[@type="submit" and @id="edit-submit-top" and @value="Compare selected revisions"]'); > + > // Compare the revisions in standard mode. > $this->submitForm([], 'Compare selected revisions'); > $this->clickLink('Split fields'); > @@ -207,7 +211,7 @@ class DiffRevisionTest extends DiffTestBase { > // Assert that there are no radio buttons for revision selection. > $this->assertSession()->elementNotExists('xpath','//input[@type="radio"]'); > // Assert that there is no submit button. > - $this->assertSession()->elementNotExists('xpath','//input[@type="submit" and text()="Compare selected revisions"]'); > + $this->assertSession()->elementNotExists('xpath','//input[@type="submit" and @value="Compare selected revisions"]'); > > // Create two new revisions of node. > $edit = [ > @@ -285,6 +289,58 @@ class DiffRevisionTest extends DiffTestBase { > } > } > > + /** > + * Tests pager on diff overview. > + */ > + public function testRevisionOverviewLong() { > + $this->drupalPlaceBlock('system_breadcrumb_block'); > + // Login as admin with the required permission. > + $this->loginAsAdmin(['delete any article content']); > + > + // Create an article. > + $title = 'test_title_a'; > + $edit = array( > + 'title[0][value]' => $title, > + 'body[0][value]' => '
Revision 1
> +first_unique_text
> +second_unique_text
', > + ); > + // Set to published if content moderation is enabled. > + if (\Drupal::moduleHandler()->moduleExists('content_moderation')) { > + $edit['moderation_state[0][state]'] = 'published'; > + } > + $this->drupalPostNodeForm('node/add/article', $edit, t('Save and publish')); > + $node = $this->drupalGetNodeByTitle($title); > + $this->drupalGet('node/' . $node->id()); > + > + // Create a second revision, with a revision comment. > + for ($i = 2; $i <= 6; $i++) { > + $edit = [ > + 'body[0][value]' => 'Revision ' . $i . '
> +first_unique_text
> +second_unique_text
', > + 'revision' => TRUE, > + 'revision_log[0][value]' => 'Revision ' . $i . ' comment', > + ]; > + // Set to published if content moderation is enabled. > + if (\Drupal::moduleHandler()->moduleExists('content_moderation')) { > + $edit['moderation_state[0][state]'] = 'published'; > + } > + $this->drupalPostNodeForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); > + } > + $this->drupalGet('node/' . $node->id()); > + > + // Check the revisions overview. > + $this->clickLink(t('Revisions')); > + $rows = $this->xpath('//tbody/tr'); > + // Make sure only two revisions available. > + $this->assertCount(6, $rows); > + > + // Assert the submit button. > + $this->assertSession()->elementExists('xpath','//input[@type="submit" and @id="edit-submit-top" and @value="Compare selected revisions"]'); > + $this->assertSession()->elementExists('xpath','//input[@type="submit" and @id="edit-submit-bottom" and @value="Compare selected revisions"]'); > + } > + > /** > * Tests pager on diff overview. > */