From 9f3fb74aabaeb6115c59311af469efb499d452a7 Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Wed, 30 Mar 2016 16:55:15 -0400 Subject: [PATCH] Fix tests broken by removal of redundant title on Log Out. --- .../src/VuFindTest/Mink/FavoritesTest.php | 4 ++-- .../src/VuFindTest/Mink/RecordActionsTest.php | 10 +++++----- themes/bootstrap3/js/lightbox.js | 2 +- themes/bootstrap3/templates/header.phtml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/FavoritesTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/FavoritesTest.php index 0c1dc171fb7..187995fcaec 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/FavoritesTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/FavoritesTest.php @@ -159,7 +159,7 @@ class FavoritesTest extends \VuFindTest\Unit\MinkTestCase $this->snooze(); $this->findCss($page, '.resultItemLine1 a')->click(); $this->assertEquals($recordURL, $this->stripHash($session->getCurrentUrl())); - $this->findCss($page, '.logoutOptions a[title="Log Out"]')->click(); + $this->findCss($page, '.logoutOptions a.logout')->click(); } /** @@ -306,7 +306,7 @@ class FavoritesTest extends \VuFindTest\Unit\MinkTestCase $this->findCss($page, '.resultItemLine1 a')->click(); $this->snooze(); $this->assertEquals($recordURL, $session->getCurrentUrl()); - $this->findCss($page, '.logoutOptions a[title="Log Out"]')->click(); + $this->findCss($page, '.logoutOptions a.logout')->click(); } /** diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php index ba696e103bd..f161dfb61d9 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php @@ -130,7 +130,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase $this->snooze(); // wait for UI update $this->assertNull($page->find('css', '.comment.row')); // Logout - $this->findCss($page, '.logoutOptions a[title="Log Out"]')->click(); + $this->findCss($page, '.logoutOptions a.logout')->click(); } /** @@ -163,7 +163,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase $this->findCss($page, '.modal #addtag_tag'); $this->findCss($page, '.modal .close')->click(); $this->snooze(); // wait for display to update - $this->findCss($page, '.logoutOptions a[title="Log Out"]')->click(); + $this->findCss($page, '.logoutOptions a.logout')->click(); $this->snooze(); // Login $page = $this->gotoRecord(); // redirects to search home??? @@ -203,7 +203,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase } $this->assertEquals(3, $sum); // Log out - $this->findCss($page, '.logoutOptions a[title="Log Out"]')->click(); + $this->findCss($page, '.logoutOptions a.logout')->click(); $this->snooze(); // wait for UI update // Flat tags @@ -231,7 +231,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase $this->snooze(); // Check selected == 0 $this->assertNull($page->find('css', '.tagList .tag.selected')); - $this->findCss($page, '.logoutOptions a[title="Log Out"]')->click(); + $this->findCss($page, '.logoutOptions a.logout')->click(); } /** @@ -281,7 +281,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase // Check for confirmation message $this->findCss($page, '.modal .alert-success'); // Logout - $this->findCss($page, '.logoutOptions a[title="Log Out"]')->click(); + $this->findCss($page, '.logoutOptions a.logout')->click(); } /** diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index c5fe50ad825..6566d0dc468 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -68,7 +68,7 @@ VuFind.lightbox = (function() { }; var flashMessage = function(message, type) { _modalBody.find('.alert,.fa.fa-spinner').remove(); - _modalBody.find('h2:first-child') + _modalBody.find('h2:first-of-type') .after('<div class="alert alert-'+type+'">'+message+'</div>'); }; diff --git a/themes/bootstrap3/templates/header.phtml b/themes/bootstrap3/templates/header.phtml index dc589305e6e..9064fdcce41 100644 --- a/themes/bootstrap3/templates/header.phtml +++ b/themes/bootstrap3/templates/header.phtml @@ -30,7 +30,7 @@ <a href="<?=$this->url('myresearch-home', array(), array('query' => array('redirect' => 0)))?>"><i class="fa fa-home"></i> <?=$this->transEsc("Your Account")?></a> </li> <li class="logoutOptions<? if(!$account->isLoggedIn()): ?> hidden<? endif ?>"> - <a href="<?=$this->url('myresearch-logout')?>"><i class="fa fa-sign-out"></i> <?=$this->transEsc("Log Out")?></a> + <a href="<?=$this->url('myresearch-logout')?>" class="logout"><i class="fa fa-sign-out"></i> <?=$this->transEsc("Log Out")?></a> </li> <li id="loginOptions"<? if($account->isLoggedIn()): ?> class="hidden"<? endif ?>> <? if ($account->getSessionInitiator($this->serverUrl($this->url('myresearch-home')))): ?> -- GitLab