feat: additional test coverage for Minerva 'TOOLBOX'

Bug: T66315

Change-Id: I03cb66a55fddcbae31e6f59f268ccfa7a31318ef
This commit is contained in:
Sean Leong (WMDE) 2024-09-16 12:44:57 +02:00 committed by Seanleong-wmde
parent 52a6a1a147
commit 92a0197c9f

View file

@ -112,6 +112,18 @@ class SkinMinervaTest extends MediaWikiIntegrationTestCase {
]
]
], true ];
yield "wikibase item exists in both toolbar and in other projects" => [ [
'TOOLBOX' => [
'wikibase' => [
'id' => 't-wikibase',
],
],
'wikibase-otherprojects' => [
[
'id' => 't-wikibase',
]
]
], true ];
yield "no wikibase item connected" => [ [
'TOOLBOX' => [
],
@ -129,8 +141,10 @@ class SkinMinervaTest extends MediaWikiIntegrationTestCase {
$sidebar = SkinMinerva::moveWikibaseLinkToToolbox( $sidebar );
if ( $linkExists ) {
$this->assertArrayHasKey( 'wikibase', $sidebar['TOOLBOX'] );
$this->assertEquals( 'wikibase', array_key_last( $sidebar['TOOLBOX'] ) );
} else {
$this->assertArrayNotHasKey( 'wikibase', $sidebar['TOOLBOX'] ?? [] );
$this->assertNotEquals( 'wikibase', array_key_last( $sidebar['TOOLBOX'] ?? [] ) );
}
}