From 0fc7be61c1afee8dd2aa5d7daccc4efc6006024d Mon Sep 17 00:00:00 2001 From: bwang Date: Mon, 14 Jun 2021 13:47:42 -0500 Subject: [PATCH] Update tests for default Menu template value Change-Id: I32586a379cbacaad5cfb361facf79c01e982818a --- stories/types.js | 1 + tests/phpunit/integration/SkinVectorTest.php | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/stories/types.js b/stories/types.js index 906f9404..bf95f5fa 100644 --- a/stories/types.js +++ b/stories/types.js @@ -59,6 +59,7 @@ * @property {string} [class] of menu * @property {string} [html-user-language-attributes] * @property {boolean} [is-dropdown] + * @property {string} [html-before-portal] Additional HTML specific to portal menus. * @property {string} [html-after-portal] Additional HTML specific to portal menus. */ diff --git a/tests/phpunit/integration/SkinVectorTest.php b/tests/phpunit/integration/SkinVectorTest.php index 9189de62..8db350b2 100644 --- a/tests/phpunit/integration/SkinVectorTest.php +++ b/tests/phpunit/integration/SkinVectorTest.php @@ -80,6 +80,11 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase { $views = $props['data-views']; $namespaces = $props['data-namespaces']; + // Can be removed when https://gerrit.wikimedia.org/r/c/mediawiki/core/+/699446 is merged. + if ( !array_key_exists( 'html-before-portal', $views ) ) { + $views = wfArrayInsertAfter( $views, [ 'html-before-portal' => '' ], 'html-after-portal' ); + } + $this->assertSame( [ // Provided by core @@ -88,11 +93,14 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase { 'html-tooltip' => '', 'html-items' => '', 'html-after-portal' => '', + 'html-before-portal' => '', 'label' => $context->msg( 'views' )->text(), 'heading-class' => 'vector-menu-heading', 'is-dropdown' => false, ], - $views + $views, + 0, + true ); $variants = $props['data-variants'];