Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embeds: add 'Embed' to title for clarity #63371

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ exports[`Embed block edit URL sets empty state when setting an empty URL 1`] = `

exports[`Embed block insert via slash inserter insert generic embed block 1`] = `"<!-- wp:embed /-->"`;

exports[`Embed block insert via slash inserter inserts Twitter embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"twitter","responsive":true} /-->"`;
exports[`Embed block insert via slash inserter inserts Twitter Embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"twitter","responsive":true} /-->"`;

exports[`Embed block insert via slash inserter inserts Vimeo embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"vimeo","responsive":true} /-->"`;
exports[`Embed block insert via slash inserter inserts Vimeo Embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"vimeo","responsive":true} /-->"`;

exports[`Embed block insert via slash inserter inserts WordPress embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"wordpress"} /-->"`;
exports[`Embed block insert via slash inserter inserts WordPress Embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"wordpress"} /-->"`;

exports[`Embed block insert via slash inserter inserts YouTube embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"youtube","responsive":true} /-->"`;
exports[`Embed block insert via slash inserter inserts YouTube Embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"youtube","responsive":true} /-->"`;

exports[`Embed block insertion inserts Twitter embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"twitter","responsive":true} /-->"`;
exports[`Embed block insertion inserts Twitter Embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"twitter","responsive":true} /-->"`;

exports[`Embed block insertion inserts Vimeo embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"vimeo","responsive":true} /-->"`;
exports[`Embed block insertion inserts Vimeo Embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"vimeo","responsive":true} /-->"`;

exports[`Embed block insertion inserts WordPress embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"wordpress"} /-->"`;
exports[`Embed block insertion inserts WordPress Embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"wordpress"} /-->"`;

exports[`Embed block insertion inserts YouTube embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"youtube","responsive":true} /-->"`;
exports[`Embed block insertion inserts YouTube Embed block 1`] = `"<!-- wp:embed {"providerNameSlug":"youtube","responsive":true} /-->"`;

exports[`Embed block insertion inserts generic embed block 1`] = `"<!-- wp:embed /-->"`;

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/embed/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe( 'utils', () => {
expect( getEmbedInfoByProvider( 'instagram' ) ).toEqual(
expect.objectContaining( {
icon: embedInstagramIcon,
title: 'Instagram',
title: 'Instagram Embed',
} )
);
} );
Expand Down
47 changes: 24 additions & 23 deletions packages/block-library/src/embed/test/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe( 'Embed block', () => {
} );

MOST_USED_PROVIDERS.forEach( ( { title } ) =>
it( `inserts ${ title } embed block`, async () => {
it( `inserts ${ title } block`, async () => {
const { block } = await insertEmbedBlock( title );
const blockName = within( block ).getByText( title );

Expand Down Expand Up @@ -285,10 +285,10 @@ describe( 'Embed block', () => {
const blockSettingsModal = await editor.findByTestId(
'block-settings-modal'
);
// Get Twitter link field.
// Get Twitter Embed link field.
const twitterLinkField = within(
blockSettingsModal
).getByLabelText( `Twitter link, ${ expectedURL }` );
).getByLabelText( `Twitter Embed link, ${ expectedURL }` );

expect( twitterLinkField ).toBeDefined();
expect( getEditorHtml() ).toMatchSnapshot();
Expand Down Expand Up @@ -321,10 +321,10 @@ describe( 'Embed block', () => {
const blockSettingsModal = await editor.findByTestId(
'block-settings-modal'
);
// Get Twitter link field.
// Get Twitter Embed link field.
const twitterLinkField = within(
blockSettingsModal
).getByLabelText( `Twitter link, ${ clipboardURL }` );
).getByLabelText( `Twitter Embed link, ${ clipboardURL }` );

expect( autopastedLinkField ).toBeDefined();
expect( twitterLinkField ).toBeDefined();
Expand Down Expand Up @@ -383,10 +383,10 @@ describe( 'Embed block', () => {
const blockSettingsModal = await editor.findByTestId(
'block-settings-modal'
);
// Get Twitter link field.
// Get Twitter Embed link field.
const twitterLinkField = within(
blockSettingsModal
).getByLabelText( `Twitter link, ${ expectedURL }` );
).getByLabelText( `Twitter Embed link, ${ expectedURL }` );

expect( twitterLinkField ).toBeDefined();
expect( getEditorHtml() ).toMatchSnapshot();
Expand Down Expand Up @@ -422,10 +422,10 @@ describe( 'Embed block', () => {
const blockSettingsModal = await editor.findByTestId(
'block-settings-modal'
);
// Get Twitter link field.
// Get Twitter Embed link field.
const twitterLinkField = within(
blockSettingsModal
).getByLabelText( `Twitter link, ${ clipboardURL }` );
).getByLabelText( `Twitter Embed link, ${ clipboardURL }` );

expect( embedLink ).toBeDefined();
expect( twitterLinkField ).toBeDefined();
Expand Down Expand Up @@ -472,10 +472,10 @@ describe( 'Embed block', () => {
);
await waitForModalVisible( blockSettingsModal );

// Start editing link.
// Start editing Embed link.
fireEvent.press(
within( blockSettingsModal ).getByLabelText(
`Twitter link, ${ initialURL }`
`Twitter Embed link, ${ initialURL }`
)
);

Expand All @@ -491,10 +491,10 @@ describe( 'Embed block', () => {
await waitFor( () => editor.UNSAFE_getByType( WebView ) );
await editor.findByText( 'Media settings' );

// Get YouTube link field.
// Get YouTube Embed link field.
const youtubeLinkField = await within(
blockSettingsModal
).findByLabelText( `YouTube link, ${ expectedURL }` );
).findByLabelText( `YouTube Embed link, ${ expectedURL }` );

expect( youtubeLinkField ).toBeDefined();
expect( getEditorHtml() ).toMatchSnapshot();
Expand All @@ -519,7 +519,7 @@ describe( 'Embed block', () => {
// Start editing link.
fireEvent.press(
within( blockSettingsModal ).getByLabelText(
`Twitter link, ${ previousURL }`
`Twitter Embed link, ${ previousURL }`
)
);

Expand Down Expand Up @@ -557,7 +557,7 @@ describe( 'Embed block', () => {
// Start editing link.
fireEvent.press(
within( blockSettingsModal ).getByLabelText(
`Twitter link, ${ previousURL }`
`Twitter Embed link, ${ previousURL }`
)
);

Expand Down Expand Up @@ -661,10 +661,10 @@ describe( 'Embed block', () => {
fireEvent( blockSettingsModal, 'backdropPress' );
fireEvent( blockSettingsModal, MODAL_DISMISS_EVENT );

// Get Twitter link field.
// Get Twitter Embed link field.
const twitterLinkField = await within(
blockSettingsModal
).findByLabelText( `Twitter link, ${ expectedURL }` );
).findByLabelText( `Twitter Embed link, ${ expectedURL }` );

expect( twitterLinkField ).toBeDefined();
expect( getEditorHtml() ).toMatchSnapshot();
Expand Down Expand Up @@ -728,10 +728,10 @@ describe( 'Embed block', () => {
const blockSettingsModal = await editor.findByTestId(
'block-settings-modal'
);
// Get Twitter link field.
// Get Twitter Embed link field.
const twitterLinkField = within(
blockSettingsModal
).getByLabelText( `Twitter link, ${ expectedURL }` );
).getByLabelText( `Twitter Embed link, ${ expectedURL }` );

expect( twitterLinkField ).toBeDefined();
expect( getEditorHtml() ).toMatchSnapshot();
Expand Down Expand Up @@ -811,10 +811,10 @@ describe( 'Embed block', () => {
const blockSettingsModal = await editor.findByTestId(
'block-settings-modal'
);
// Get Twitter link field.
// Get Twitter embed link field.
const twitterLinkField = within(
blockSettingsModal
).getByLabelText( `Twitter link, ${ successURL }` );
).getByLabelText( `Twitter Embed link, ${ successURL }` );

expect( twitterLinkField ).toBeDefined();
expect( getEditorHtml() ).toMatchSnapshot();
Expand Down Expand Up @@ -1000,8 +1000,9 @@ describe( 'Embed block', () => {
} );

MOST_USED_PROVIDERS.forEach( ( { title } ) =>
it( `inserts ${ title } embed block`, async () => {
const embedBlockSlashInserter = `/${ title }`;
it( `inserts ${ title } block`, async () => {
// Get just the first word of the title ("Twitter") as the full title ("Twitter Embed") breaks the test.
const embedBlockSlashInserter = `/${ title.split( ' ' )[ 0 ] }`;
const editor = await initializeEditor( {
initialHtml: EMPTY_PARAGRAPH_HTML,
} );
Expand Down
Loading
Loading