Skip to content

Commit

Permalink
Update e2e test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dhananjaykuber committed Jul 3, 2024
1 parent 57da869 commit 35a125c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/block-library/src/embed/embed-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
} from '@wordpress/block-editor';
import { Component } from '@wordpress/element';
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
import { getAuthority } from '@wordpress/url';

/**
* Internal dependencies
Expand Down Expand Up @@ -73,7 +74,7 @@ class EmbedPreview extends Component {
const { interactive } = this.state;

const html = 'photo' === type ? getPhotoHtml( preview ) : preview.html;
const embedSourceUrl = new URL( url ).hostname;
const embedSourceUrl = getAuthority( url );
const iframeTitle = sprintf(
// translators: %s: host providing embed content e.g: www.youtube.com
__( 'Embedded content from %s' ),
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/embedding.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test.describe( 'Embedding content', () => {
await expect(
currenEmbedBlock.locator( 'iframe' ),
'Valid embed. Should render valid element.'
).toHaveAttribute( 'title', 'Embedded content from twitter' );
).toHaveAttribute( 'title', 'Embedded content from twitter.com' );

await embedUtils.insertEmbed(
'https://twitter.com/wooyaygutenberg123454312'
Expand Down Expand Up @@ -150,7 +150,7 @@ test.describe( 'Embedding content', () => {
await expect(
currenEmbedBlock.locator( 'iframe' ),
'Photo content. Should render valid iframe element.'
).toHaveAttribute( 'title', 'Embedded content from cloudup' );
).toHaveAttribute( 'title', 'Embedded content from cloudup.com' );
} );

test( 'should allow the user to convert unembeddable URLs to a paragraph with a link in it', async ( {
Expand Down

0 comments on commit 35a125c

Please sign in to comment.