* Remove checks for WP 5.4 from e2e tests

* Update e2e local environment set up docs
This commit is contained in:
Albert Juhé Lluveras 2021-03-23 15:09:04 +01:00 committed by GitHub
parent ef03089245
commit c7bec5bcd2
4 changed files with 34 additions and 45 deletions

View File

@ -59,7 +59,8 @@ To modify the environment used by tests locally, you will need to modify `.wp-en
```diff
{
+ "core": "WordPress/WordPress#5.6",
- "core": "WordPress/WordPress#5.7-branch",
+ "core": "WordPress/WordPress#5.6-branch",
"plugins": [
"https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip",
"https://github.com/WP-API/Basic-Auth/archive/master.zip",

View File

@ -15,7 +15,6 @@ import {
import {
insertBlockDontWaitForInsertClose,
closeInserter,
conditionalDescribe,
} from '../../utils.js';
const block = {
@ -41,27 +40,24 @@ describe( `${ block.name } Block`, () => {
} );
} );
conditionalDescribe( process.env.WP_VERSION > 5.4 )(
'before compatibility notice is dismissed',
() => {
beforeEach( async () => {
await page.evaluate( () => {
localStorage.setItem(
'wc-blocks_dismissed_compatibility_notices',
'[]'
);
} );
await visitBlockPage( `${ block.name } Block` );
} );
it( 'shows compatibility notice', async () => {
const compatibilityNoticeTitle = await page.$x(
`//h1[contains(text(), 'Compatibility notice')]`
describe( 'before compatibility notice is dismissed', () => {
beforeEach( async () => {
await page.evaluate( () => {
localStorage.setItem(
'wc-blocks_dismissed_compatibility_notices',
'[]'
);
expect( compatibilityNoticeTitle.length ).toBe( 1 );
} );
}
);
await visitBlockPage( `${ block.name } Block` );
} );
it( 'shows compatibility notice', async () => {
const compatibilityNoticeTitle = await page.$x(
`//h1[contains(text(), 'Compatibility notice')]`
);
expect( compatibilityNoticeTitle.length ).toBe( 1 );
} );
} );
describe( 'once compatibility notice is dismissed', () => {
beforeEach( async () => {

View File

@ -14,7 +14,6 @@ import {
import {
insertBlockDontWaitForInsertClose,
closeInserter,
conditionalDescribe,
} from '../../utils.js';
const block = {
@ -40,27 +39,24 @@ describe( `${ block.name } Block`, () => {
} );
} );
conditionalDescribe( process.env.WP_VERSION > 5.4 )(
'before compatibility notice is dismissed',
() => {
beforeEach( async () => {
await page.evaluate( () => {
localStorage.setItem(
'wc-blocks_dismissed_compatibility_notices',
'[]'
);
} );
await visitBlockPage( `${ block.name } Block` );
} );
it( 'shows compatibility notice', async () => {
const compatibilityNoticeTitle = await page.$x(
`//h1[contains(text(), 'Compatibility notice')]`
describe( 'before compatibility notice is dismissed', () => {
beforeEach( async () => {
await page.evaluate( () => {
localStorage.setItem(
'wc-blocks_dismissed_compatibility_notices',
'[]'
);
expect( compatibilityNoticeTitle.length ).toBe( 1 );
} );
}
);
await visitBlockPage( `${ block.name } Block` );
} );
it( 'shows compatibility notice', async () => {
const compatibilityNoticeTitle = await page.$x(
`//h1[contains(text(), 'Compatibility notice')]`
);
expect( compatibilityNoticeTitle.length ).toBe( 1 );
} );
} );
describe( 'once compatibility notice is dismissed', () => {
beforeEach( async () => {

View File

@ -20,7 +20,3 @@ export async function insertBlockDontWaitForInsertClose( searchTerm ) {
export const closeInserter = async () => {
await page.click( '.edit-post-header [aria-label="Add block"]' );
};
export const conditionalDescribe = ( condition ) => {
return condition ? describe : describe.skip;
};