diff --git a/src/Tests/ParagraphsCollectionOverviewTest.php b/src/Tests/ParagraphsCollectionOverviewTest.php new file mode 100644 index 0000000..65a2dcb --- /dev/null +++ b/src/Tests/ParagraphsCollectionOverviewTest.php @@ -0,0 +1,87 @@ +loginAsAdmin([ + 'administer paragraphs types', + 'access site reports', + ]); + + // Check the new link on the reports page. + $this->drupalGet('/admin/reports'); + $this->assertText('Overviews of items discoverable by behavior plugins.'); + $this->clickLink('Paragraphs Collection'); + + // Check the grid layouts overview. + $this->assertUrl('/admin/reports/paragraphs_collection/layouts'); + $this->assertTitle('Available grid layouts | Drupal'); + $this->assertText('Grid layout label or ID'); + $this->assertText('Details'); + $this->assertText('Used in'); + + // Check that a concrete grid layout is displayed. + $this->assertText('Two columns'); + $this->assertText('Defines a two column layout with 8-4 widths'); + $this->assertText('paragraphs_two_column'); + $this->assertLink('Grid'); + $this->assertLinkByHref('/admin/structure/paragraphs_type/grid'); + + // Check the tabs. + $this->assertLink('Layouts'); + $this->clickLink('Styles'); + + // Check the styles layouts overview. + $this->assertUrl('/admin/reports/paragraphs_collection/styles'); + $this->assertTitle('Available styles | Drupal'); + $this->assertText('Group'); + $this->assertText('Style label or ID'); + $this->assertText('Details'); + $this->assertText('Used in'); + + // Check that a concrete style is displayed. + $this->assertText('Blue'); + $this->assertText('paragraphs-blue'); + $this->assertText('General Group'); + $this->assertLink('Container'); + $this->assertLinkByHref('/admin/structure/paragraphs_type/paragraphs_container'); + + // Check the tabs. + $this->assertLink('Layouts'); + $this->assertLink('Styles'); + } + +}