Skip to content

Commit

Permalink
Fix failing e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Jan 21, 2020
1 parent 392fa7e commit f562b8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ function NavigationLinkEdit( {
<div className="wp-block-navigation-link__content">
<RichText
tagName="span"
className="wp-block-navigation-link__label"
value={ label }
onChange={ ( labelValue ) => setAttributes( { label: labelValue } ) }
placeholder={ itemLabelPlaceholder }
Expand Down
5 changes: 4 additions & 1 deletion packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ function build_navigation_html( $attributes, $block, $colors, $font_sizes, $is_l
// End appending HTML attributes to anchor tag.

// Start anchor tag content.
$html .= '><span>'; // Wrap title with span to isolate it from submenu icon.
$html .= '>' .
// Wrap title with span to isolate it from submenu icon.
'<span class="wp-block-navigation-link__label">';

if ( isset( $block['attrs']['label'] ) ) {
$html .= wp_kses(
$block['attrs']['label'],
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/specs/editor/blocks/navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function updateActiveNavigationLink( { url, label } ) {
}

if ( label ) {
await page.click( '.wp-block-navigation-link__content.is-selected' );
await page.click( '.wp-block-navigation-link__label.is-selected' );

// Ideally this would be `await pressKeyWithModifier( 'primary', 'a' )`
// to select all text like other tests do.
Expand Down

0 comments on commit f562b8a

Please sign in to comment.