Commit 21acfa62 authored by webchick's avatar webchick

Issue #2784881 by tedbow, bnjmnm, RajeevK: Update Outside-In Javascript based...

Issue #2784881 by tedbow, bnjmnm, RajeevK: Update Outside-In Javascript based tests to test against all core themes
parent a3e56b17
......@@ -12,15 +12,20 @@ class OffCanvasTest extends OutsideInJavascriptTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['block', 'system', 'toolbar', 'outside_in', 'off_canvas_test'];
public static $modules = [
'block',
'system',
'toolbar',
'outside_in',
'off_canvas_test',
];
/**
* Tests that regular non-contextual links will work with the off-canvas dialog.
* Tests that non-contextual links will work with the off-canvas dialog.
*/
public function testOffCanvasLinks() {
$themes = ['bartik', 'stark'];
// Test the same functionality on multiple themes.
foreach ($themes as $theme) {
foreach ($this->getTestThemes() as $theme) {
$this->enableTheme($theme);
$this->drupalGet('/off-canvas-test-links');
......@@ -73,7 +78,6 @@ public function testOffCanvasLinks() {
* Tests the body displacement behaves differently at a narrow width.
*/
public function testNarrowWidth() {
$themes = ['stark', 'bartik'];
$narrow_width_breakpoint = 768;
$offset = 20;
$height = 800;
......@@ -81,7 +85,7 @@ public function testNarrowWidth() {
$web_assert = $this->assertSession();
// Test the same functionality on multiple themes.
foreach ($themes as $theme) {
foreach ($this->getTestThemes() as $theme) {
$this->enableTheme($theme);
// Testing at the wider width.
$this->getSession()->resizeWindow($narrow_width_breakpoint + $offset, $height);
......@@ -103,4 +107,13 @@ public function testNarrowWidth() {
}
}
/**
* {@inheritdoc}
*/
protected function getTestThemes() {
// Add 'seven' theme. Setting Tray "Edit Mode" will not work with 'seven'
// because it removes all contextual links the off-canvas dialog should.
return array_merge(parent::getTestThemes(), ['seven']);
}
}
......@@ -130,4 +130,14 @@ protected function waitForToolbarToLoad() {
$web_assert->assertWaitOnAjaxRequest();
}
/**
* Get themes to test.
*
* @return string[]
* Theme names to test.
*/
protected function getTestThemes() {
return ['bartik', 'stark', 'classy', 'stable'];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment