Skip to content

Commit

Permalink
Update testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
laceysanderson committed Mar 30, 2024
1 parent 7203598 commit 379fcbb
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/src/Functional/InstallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Simple test to ensure that main page loads with module enabled.
*
* @group TripGeno Genetics
* @group TripalBlast
* @group Installation
*/
class InstallTest extends ChadoTestBrowserBase {
Expand Down
45 changes: 45 additions & 0 deletions tests/src/Functional/UserInterfaceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace Drupal\Tests\tripal_blast\Functional;

use Drupal\Core\Url;
use Drupal\Tests\tripal_chado\Functional\ChadoTestBrowserBase;

/**
* Checks the main user program listing found at SITE/blast.
*
* @group TripalBlast
* @group User Interface
*/
class UserInterfaceTest extends ChadoTestBrowserBase {

protected $defaultTheme = 'stark';

/**
* Modules to enable.
*
* @var array
*/
protected static $modules = ['tripal','tripal_blast'];

/**
* Tests that a specific set of pages load with a 200 response.
*/
public function testLoadUI() {
$session = $this->getSession();

// Ensure we have an admin user.
$user = $this->drupalCreateUser(['access content']);
$this->drupalLogin($user);

$context = '(modules installed: ' . implode(',', self::$modules) . ')';

// Blast UI
$this->drupalGet(Url::fromRoute('tripal_blast.blast_ui'));
$status_code = $session->getStatusCode();
$this->assertEquals(200, $status_code, "The blast user interface listing the programs available should be able to load.");



}
}
4 changes: 2 additions & 2 deletions tripal_blast.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tripal_blast.blast_ui:
_title: 'Tripal BLAST'
_controller: '\Drupal\tripal_blast\Controller\TripalBlastUIController::ui'
requirements:
_permission: 'administer tripal'
_permission: 'access content'


# Routes below are for two main query types BLAST shown in the UI.
Expand All @@ -22,7 +22,7 @@ tripal_blast.blast_program:
_title: 'Tripal BLAST'
_form: '\Drupal\tripal_blast\Form\TripalBlastForm'
requirements:
_permission: 'administer tripal'
_permission: 'access content'
query: 'nucleotide|protein'
db: 'nucleotide|protein'

Expand Down

0 comments on commit 379fcbb

Please sign in to comment.