diff --git a/docker-compose.yml b/docker-compose.yml
index fe9840fbe9..a9fbfda111 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -28,7 +28,9 @@ services:
image: selenium/standalone-chrome-debug:3.11
environment:
- DISPLAY=:99
- - SE_OPTS=-debug
+ - SCREEN_WIDTH=1440
+ - SCREEN_HEIGHT=900
+ - VNC_NO_PASSWORD=1
ports:
- "5900:5900"
expose:
diff --git a/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationParagraphTest.php b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationParagraphTest.php
new file mode 100644
index 0000000000..77477f56f3
--- /dev/null
+++ b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationParagraphTest.php
@@ -0,0 +1,101 @@
+container->get('theme_installer')->install(['oe_theme']);
+ $this->config('system.theme')->set('default', 'oe_theme')->save();
+ $this->container->set('theme.registry', NULL);
+
+ // Rebuild the ui_pattern definitions to collect the ones provided by
+ // oe_theme itself.
+ \Drupal::service('plugin.manager.ui_patterns')->clearCachedDefinitions();
+
+ FilterFormat::create([
+ 'format' => 'full_html',
+ 'name' => 'Full HTML',
+ ])->save();
+ }
+
+ /**
+ * Tests the inpage nav variant of the content row paragraph type.
+ */
+ public function testInpageNavigationInParagraphContentRow(): void {
+ // Create a rich text paragraph with a title and a heading in the body.
+ $paragraph = Paragraph::create([
+ 'type' => 'oe_rich_text',
+ 'field_oe_title' => 'Rich text title',
+ 'field_oe_text_long' => [
+ 'value' => 'The rich text body.
- {% include '@ecl-twig/inpage-navigation' with {
- 'title': title,
- 'links': links,
- 'icon_path': ecl_icon_path
- } %}
+ {{ inpage }}
{{ content.field_oe_paragraphs }}
diff --git a/tests/src/Kernel/Paragraphs/ContentRowTest.php b/tests/src/Kernel/Paragraphs/ContentRowTest.php
index 849df1259c..6514b0396b 100644
--- a/tests/src/Kernel/Paragraphs/ContentRowTest.php
+++ b/tests/src/Kernel/Paragraphs/ContentRowTest.php
@@ -103,11 +103,6 @@ public function testRendering(): void {
$this->assertStringContainsString('Rich text without title.', $html);
$this->assertStringContainsString('Rich text with title.', $html);
- // No page navigation should be shown.
- $this->assertCount(0, $crawler->filter('.ecl-inpage-navigation'));
- // Neither the title.
- $this->assertStringNotContainsString('Page navigation', $html);
-
// Change variant to the inpage navigation.
$paragraph->get('oe_paragraphs_variant')->setValue('inpage_navigation');
$paragraph->save();
@@ -130,15 +125,6 @@ public function testRendering(): void {
// Verify that the inpage navigation title has been rendered.
$this->assertEquals('Page navigation', trim($left_column->filter('.ecl-inpage-navigation__title')->text()));
- // Verify that only the direct children paragraphs that have a title have
- // been included as links.
- $navigation_items = $left_column->filter('ul.ecl-inpage-navigation__list li');
- $this->assertCount(3, $navigation_items);
- // Check the order, text and anchor of each item.
- $this->assertNavigationItem($navigation_items->eq(0), 'List item title', $right_column);
- $this->assertNavigationItem($navigation_items->eq(1), 'List block title', $right_column);
- $this->assertNavigationItem($navigation_items->eq(2), 'Rich text title', $right_column);
-
// Verify that the inpage navigation default title has been rendered.
$paragraph->get('field_oe_title')->setValue('');
$paragraph->save();
@@ -147,55 +133,9 @@ public function testRendering(): void {
// Assert that side-menu is correctly rendered with the default title.
$left_column = $crawler->filter('.ecl-row .ecl-col-l-3.ecl-u-z-navigation');
$this->assertStringContainsString('Page contents', $left_column->html());
- }
-
- /**
- * Tests that side menu title translations are rendered correctly.
- */
- public function testSideMenuTranslation(): void {
- // Create child paragraph with "French" translation.
- $child = Paragraph::create([
- 'type' => 'oe_rich_text',
- 'field_oe_title' => 'English rich text title',
- ]);
- $child->save();
-
- $child->addTranslation('fr', [
- 'type' => 'oe_rich_text',
- 'field_oe_title' => 'French rich text title',
- ])->save();
-
- // Create the main content row paragraph with "French" translation.
- $paragraph = Paragraph::create([
- 'type' => 'oe_content_row',
- 'field_oe_title' => 'English page navigation',
- 'oe_paragraphs_variant' => 'inpage_navigation',
- 'field_oe_paragraphs' => [$child],
- ]);
- $paragraph->save();
-
- $paragraph->addTranslation('fr', [
- 'type' => 'oe_content_row',
- 'field_oe_title' => 'French page navigation',
- 'oe_paragraphs_variant' => 'inpage_navigation',
- 'field_oe_paragraphs' => [$child],
- ])->save();
-
- $html = $this->renderParagraph($paragraph, 'en');
- $crawler = new Crawler($html);
-
- // Assert that side-menu "English" translation is correctly rendered.
- $left_column = $crawler->filter('.ecl-row .ecl-col-l-3.ecl-u-z-navigation');
- $this->assertStringContainsString('English page navigation', $left_column->html());
- $this->assertStringContainsString('English rich text title', $left_column->html());
- $html = $this->renderParagraph($paragraph, 'fr');
- $crawler = new Crawler($html);
-
- // Assert that side-menu "French" translation is correctly rendered.
- $left_column = $crawler->filter('.ecl-row .ecl-col-l-3.ecl-u-z-navigation');
- $this->assertStringContainsString('French page navigation', $left_column->html());
- $this->assertStringContainsString('French rich text title', $left_column->html());
+ // The actual inpage navigation links are tested in the
+ // InPageNavigationParagraphTest since they are rendered via JS.
}
/**