8
0
Эх сурвалжийг харах

Tests: Code refactoring in BalloonPanelView tests.

Aleksander Nowodzinski 5 жил өмнө
parent
commit
cb4f8567ce

+ 4 - 5
packages/ckeditor5-ui/tests/manual/panel/balloon/balloonpanelview.js

@@ -46,14 +46,13 @@ function parseHeadingText( text ) {
 	return getCapitalizedHeading( normalizedText );
 }
 
-// This helper function creates normalize heading text from a fullname of the position,
+// This helper function creates normalize heading text from a full name of the position,
 // removing `ArrowXyz` part, like in the example:
 // `southEastArrowNorthMiddleEast` -> `south East`.
 function getNormalizeHeading( text ) {
-	const headingRegex = /(w*)arrow\w*/i;
-	const headingText = text.replace( headingRegex, '$1' );
-
-	return headingText.replace( /([a-z])([A-Z])/, '$1 $2' );
+	return text
+		.replace( /(w*)arrow\w*/i, '$1' )
+		.replace( /([a-z])([A-Z])/, '$1 $2' );
 }
 
 function getCapitalizedHeading( text ) {

+ 1 - 1
packages/ckeditor5-ui/tests/manual/panel/balloon/balloonpanelview.md

@@ -1,5 +1,5 @@
 ## `BalloonPanelView` and `defaultPositions`
 
-1. A number of green rectangles should be displayed in the page.
+1. A number of colorful rectangles should be displayed in the page.
 2. Each rectangle should have a panel attached.
 3. Make sure the description in each panel matches the location of the panel.