Skip to content
Snippets Groups Projects
Commit c3cbfa74 authored by Chris Hallberg's avatar Chris Hallberg Committed by Demian Katz
Browse files

Expand tags test for case sensitivity.

parent ed43af2a
No related merge requests found
...@@ -123,7 +123,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -123,7 +123,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase
// Create new account // Create new account
$this->makeAccount($page, 'username1'); $this->makeAccount($page, 'username1');
// Make sure page updated for login // Make sure page updated for login
$page = $this->gotoRecord(); // $page = $this->gotoRecord();
$this->findCss($page, '.record-tabs .usercomments')->click(); $this->findCss($page, '.record-tabs .usercomments')->click();
$this->assertEquals(// Can Comment? $this->assertEquals(// Can Comment?
'Add your comment', 'Add your comment',
...@@ -145,7 +145,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -145,7 +145,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase
} }
/** /**
* Test adding comments on records. * Test adding tags on records.
* *
* @return void * @return void
*/ */
...@@ -173,7 +173,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -173,7 +173,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase
$this->findCss($page, '.logoutOptions a.logout')->click(); $this->findCss($page, '.logoutOptions a.logout')->click();
$this->snooze(); $this->snooze();
// Login // Login
$page = $this->gotoRecord(); // redirects to search home??? // $page = $this->gotoRecord();
$this->findCss($page, '.tag-record')->click(); $this->findCss($page, '.tag-record')->click();
$this->snooze(); $this->snooze();
$this->fillInLoginForm($page, 'username2', 'test'); $this->fillInLoginForm($page, 'username2', 'test');
...@@ -223,7 +223,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -223,7 +223,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase
$this->fillInLoginForm($page, 'username1', 'test'); $this->fillInLoginForm($page, 'username1', 'test');
$this->findCss($page, '.modal-body .btn.btn-primary')->click(); $this->findCss($page, '.modal-body .btn.btn-primary')->click();
$this->snooze(); $this->snooze();
$page = $this->gotoRecord(); // $page = $this->gotoRecord();
// Check selected == 0 // Check selected == 0
$this->assertNull($page->find('css', '.tagList .tag.selected')); $this->assertNull($page->find('css', '.tagList .tag.selected'));
$this->findCss($page, '.tagList .tag'); $this->findCss($page, '.tagList .tag');
...@@ -241,6 +241,42 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -241,6 +241,42 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase
$this->findCss($page, '.logoutOptions a.logout')->click(); $this->findCss($page, '.logoutOptions a.logout')->click();
} }
/**
* Test adding case sensitive tags on records.
*
* @return void
*/
public function testAddSensitiveTag()
{
// Change the theme:
$this->changeConfigs(
[
'config' => [
'Site' => ['theme' => 'bootstrap3'],
'Social' => ['case_sensitive_tags' => 'true']
]
]
);
// Login
$page = $this->gotoRecord();
$this->findCss($page, '.tag-record')->click();
$this->snooze();
$this->fillInLoginForm($page, 'username2', 'test');
$this->submitLoginForm($page);
// Add tags
$this->findCss($page, '.modal #addtag_tag')->setValue('one ONE "new tag" ONE "THREE 4"');
$this->findCss($page, '.modal-body .btn.btn-primary')->click();
$this->snooze();
$success = $this->findCss($page, '.modal-body .alert-success');
$this->assertEquals('Tags Saved', $success->getText());
$this->findCss($page, '.modal .close')->click();
// Count tags
$this->snooze();
$page = $this->gotoRecord();
$tags = $page->findAll('css', '.tagList .tag');
$this->assertEquals(6, count($tags));
}
/** /**
* Test record view email. * Test record view email.
* *
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment