Skip to content

Remove invalid url's and id's from media fixtures - #14625

Merged
gziolo merged 1 commit into
masterfrom
fix/media-fixtures-so-they-can-be-used-in-end2end-tests
Apr 3, 2019
Merged

gziolo merged 1 commit into
masterfrom
fix/media-fixtures-so-they-can-be-used-in-end2end-tests

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Mar 25, 2019 •

Copy link
Copy Markdown
Member

This PR removes invalid URLs and ID's from the fixtures of media blocks making sure we can use these fixtures in the block transforms test case.

A temporary solution to not execute the transforms test cases for these blocks was removed.

Depends on: #14632

How has this been tested?

Verify the end 2 end tests pass.
Verify the fixture test cases pass npm run test-unit test/integration/full-content/full-content.spec.js.

@jorgefilipecosta
jorgefilipecosta force-pushed the fix/media-fixtures-so-they-can-be-used-in-end2end-tests branch from 4455244 to 17ac886 Compare March 26, 2019 10:38
@jorgefilipecosta
jorgefilipecosta force-pushed the fix/media-fixtures-so-they-can-be-used-in-end2end-tests branch from 17ac886 to 2f2d3d6 Compare March 26, 2019 11:17
@gziolo gziolo added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Mar 28, 2019
)
)
);
const fileBasenames = getAvailableBlockFixturesBasenames();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about you update the failing test (https://travis-ci.com/WordPress/gutenberg/jobs/187619473#L1011):

Block transforms › should contain the expected transforms

to perform more relaxed check using toMatchObject:

expect(
	transforms
). toMatchObject( EXPECTED_TRANSFORMS );	

@gziolo gziolo Mar 28, 2019 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this locally and it seems to work:

it( 'example', () => {
	const actual = {
		core__gallery__columns: {
			availableTransforms: [
				'Slideshow',
				'Image',
			],
			originalBlock: 'Gallery',
		},
	};
	const expected = {
		core__gallery__columns: {
			availableTransforms: expect.arrayContaining( [
				'Image',
			] ),
			originalBlock: 'Gallery',
		},
	};

	expect( actual ).toMatchObject( expected );
} );

@jorgefilipecosta
jorgefilipecosta force-pushed the fix/media-fixtures-so-they-can-be-used-in-end2end-tests branch from 2f2d3d6 to 1e39d49 Compare March 29, 2019 22:43
@jorgefilipecosta
jorgefilipecosta force-pushed the fix/media-fixtures-so-they-can-be-used-in-end2end-tests branch from 1e39d49 to dec1e40 Compare March 29, 2019 23:54

@gziolo gziolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed it the other day. Now that it is rebased with the latest fix merged to allow us to skip tests when 3rd party plugins are installed, this should be good to go 👍

const maybeDescribe = process.env.POPULAR_PLUGINS ?
describe :
describe.skip;
describe.skip :

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha 🥇

@gziolo gziolo added this to the 5.5 (Gutenberg) milestone Apr 3, 2019
@gziolo gziolo added the [Feature] Blocks Overall functionality of blocks label Apr 3, 2019
@gziolo
gziolo merged commit ec5ed13 into master Apr 3, 2019
@gziolo
gziolo deleted the fix/media-fixtures-so-they-can-be-used-in-end2end-tests branch April 3, 2019 07:57
@pento pento mentioned this pull request Oct 20, 2021
7 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Blocks Overall functionality of blocks [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants