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

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

Merged

Conversation

jorgefilipecosta
Copy link
Member

@jorgefilipecosta jorgefilipecosta commented Mar 25, 2019

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
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 );	

Copy link
Member

@gziolo gziolo Mar 28, 2019

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
Copy link
Member

@gziolo gziolo left a comment

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 👍

@@ -98,32 +97,11 @@ const getTransformResult = async ( blockContent, transformName ) => {
// Skipping all the tests when plugins are enabled
// makes sure the tests are not executed, and no unused snapshots errors are thrown.
const maybeDescribe = process.env.POPULAR_PLUGINS ?
describe :
describe.skip;
describe.skip :
Copy link
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
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