Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall committed Apr 23, 2024
1 parent b13f980 commit 3e49f9d
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions tests/src/FunctionalJavascript/IntegerWeightTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class IntegerWeightTest extends WebDriverTestBase {
'views',
'field_ui',
'integer_weight_test_views',
'islandora',
];

/**
Expand Down Expand Up @@ -83,24 +84,13 @@ class IntegerWeightTest extends WebDriverTestBase {
*/
public function setUp(): void {
parent::setUp();
$this->drupalCreateContentType([
'type' => 'repo_item',
'name' => 'Repository Item',
]);

$this->drupalLogin($this->createUser(['edit any repo_item content'], 'test', TRUE));

$this->adminUser = $this->drupalCreateUser(
[
'administer content types',
'administer node fields',
'administer node display',
]
);

// Create dummy repo_item type to sort (since we don't have
// repository_object without islandora_defaults).
$type = $this->container->get('entity_type.manager')->getStorage('node_type')
->create([
'type' => 'repo_item',
'name' => 'Repository Item',
]);
$type->save();
$this->container->get('router.builder')->rebuild();

$fieldStorage = FieldStorageConfig::create([
'field_name' => static::$fieldName,
Expand Down Expand Up @@ -132,9 +122,11 @@ public function setUp(): void {
* Test integer weight selector.
*/
public function testIntegerWeightSelector() {
$this->drupalGet('test-integer-weight');
$page = $this->getSession()->getPage();
$web_assert = $this->assertSession();
$this->drupalGet('/test-integer-weight');
$web_assert->pageTextContains('Item 1');

$page = $this->getSession()->getPage();
$weight_select1 = $page->findField("field_integer_weight[0][weight]");
$weight_select2 = $page->findField("field_integer_weight[1][weight]");
$weight_select3 = $page->findField("field_integer_weight[2][weight]");
Expand Down

0 comments on commit 3e49f9d

Please sign in to comment.