Skip to content

Commit

Permalink
Adding test coverage for patter template override
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Maira committed Oct 30, 2019
1 parent fc231ec commit e66667d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Foo Bar
Foo Bar default template
13 changes: 13 additions & 0 deletions tests/src/Functional/UiPatternsPreviewRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ public function testPatternPreviewSuggestions() {
foreach ($suggestions as $suggestion) {
$assert_session->responseContains($suggestion);
}

// Pattern foo-bar default template is loaded.
$assert_session->pageTextContains('Foo Bar default template');
$assert_session->pageTextNotContains('Foo Bar overridden template');

// Install test theme to load template(s) overrides.
$this->container->get('theme_installer')->install(['ui_patterns_theme_test']);
$this->container->get('theme_handler')->setDefault('ui_patterns_theme_test');
$this->container->set('theme.registry', NULL);

$this->drupalGet('/patterns');
$assert_session->pageTextContains('Foo Bar overridden template');
$assert_session->pageTextNotContains('Foo Bar default template');
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Foo Bar overridden template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: 'UI Patterns Test theme'
type: theme
description: 'Theme for testing UI Patterns features in action on a theme.'
core: 8.x

0 comments on commit e66667d

Please sign in to comment.