Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Fritsch committed Jul 11, 2024
1 parent e063828 commit d622721
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion tests/src/FunctionalJavascript/MediaGalleryModifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public function testAddRemove(): void {

$this->clickSave();


// Check that there are 4 images in gallery.
$this->assertEquals(
4,
Expand Down
7 changes: 5 additions & 2 deletions tests/src/FunctionalJavascript/NodeCreationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ public function testCreateNode(string $contentType, string $contentTypeDisplayNa
$this->assertSession()->pageTextContains('Awesome text');

// Check Gallery paragraph. Ensure that there are 2 images in gallery.
$this->assertSession()
->elementsCount('xpath', '//div[contains(@class, "field--name-field-paragraphs")]/div[contains(@class, "field__item")][3]//div[contains(@class, "slick-track")]/div[not(contains(@class, "slick-cloned"))]//img', 2);
$this->assertEquals(
2,
$this->getSession()->evaluateScript('document.querySelectorAll("div.field--name-field-media-images div.field__item img").length'),
'There should be five images shown in frontend.'
);

// Check Quote paragraph.
$this->assertSession()->pageTextContains('Awesome quote');
Expand Down

0 comments on commit d622721

Please sign in to comment.