Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 4851653

Browse files
authored
Remove checks for WP 5.4 from e2e tests (#3993)
* Remove checks for WP 5.4 from e2e tests * Update e2e local environment set up docs
1 parent 3f698f6 commit 4851653

File tree

4 files changed

+34
-45
lines changed

4 files changed

+34
-45
lines changed

docs/contributors/javascript-testing.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ To modify the environment used by tests locally, you will need to modify `.wp-en
5959

6060
```diff
6161
{
62-
+ "core": "WordPress/WordPress#5.6",
62+
- "core": "WordPress/WordPress#5.7-branch",
63+
+ "core": "WordPress/WordPress#5.6-branch",
6364
"plugins": [
6465
"https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip",
6566
"https://github.com/WP-API/Basic-Auth/archive/master.zip",

tests/e2e/specs/backend/cart.test.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
import {
1616
insertBlockDontWaitForInsertClose,
1717
closeInserter,
18-
conditionalDescribe,
1918
} from '../../utils.js';
2019

2120
const block = {
@@ -41,27 +40,24 @@ describe( `${ block.name } Block`, () => {
4140
} );
4241
} );
4342

44-
conditionalDescribe( process.env.WP_VERSION > 5.4 )(
45-
'before compatibility notice is dismissed',
46-
() => {
47-
beforeEach( async () => {
48-
await page.evaluate( () => {
49-
localStorage.setItem(
50-
'wc-blocks_dismissed_compatibility_notices',
51-
'[]'
52-
);
53-
} );
54-
await visitBlockPage( `${ block.name } Block` );
55-
} );
56-
57-
it( 'shows compatibility notice', async () => {
58-
const compatibilityNoticeTitle = await page.$x(
59-
`//h1[contains(text(), 'Compatibility notice')]`
43+
describe( 'before compatibility notice is dismissed', () => {
44+
beforeEach( async () => {
45+
await page.evaluate( () => {
46+
localStorage.setItem(
47+
'wc-blocks_dismissed_compatibility_notices',
48+
'[]'
6049
);
61-
expect( compatibilityNoticeTitle.length ).toBe( 1 );
6250
} );
63-
}
64-
);
51+
await visitBlockPage( `${ block.name } Block` );
52+
} );
53+
54+
it( 'shows compatibility notice', async () => {
55+
const compatibilityNoticeTitle = await page.$x(
56+
`//h1[contains(text(), 'Compatibility notice')]`
57+
);
58+
expect( compatibilityNoticeTitle.length ).toBe( 1 );
59+
} );
60+
} );
6561

6662
describe( 'once compatibility notice is dismissed', () => {
6763
beforeEach( async () => {

tests/e2e/specs/backend/checkout.test.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
import {
1515
insertBlockDontWaitForInsertClose,
1616
closeInserter,
17-
conditionalDescribe,
1817
} from '../../utils.js';
1918

2019
const block = {
@@ -40,27 +39,24 @@ describe( `${ block.name } Block`, () => {
4039
} );
4140
} );
4241

43-
conditionalDescribe( process.env.WP_VERSION > 5.4 )(
44-
'before compatibility notice is dismissed',
45-
() => {
46-
beforeEach( async () => {
47-
await page.evaluate( () => {
48-
localStorage.setItem(
49-
'wc-blocks_dismissed_compatibility_notices',
50-
'[]'
51-
);
52-
} );
53-
await visitBlockPage( `${ block.name } Block` );
54-
} );
55-
56-
it( 'shows compatibility notice', async () => {
57-
const compatibilityNoticeTitle = await page.$x(
58-
`//h1[contains(text(), 'Compatibility notice')]`
42+
describe( 'before compatibility notice is dismissed', () => {
43+
beforeEach( async () => {
44+
await page.evaluate( () => {
45+
localStorage.setItem(
46+
'wc-blocks_dismissed_compatibility_notices',
47+
'[]'
5948
);
60-
expect( compatibilityNoticeTitle.length ).toBe( 1 );
6149
} );
62-
}
63-
);
50+
await visitBlockPage( `${ block.name } Block` );
51+
} );
52+
53+
it( 'shows compatibility notice', async () => {
54+
const compatibilityNoticeTitle = await page.$x(
55+
`//h1[contains(text(), 'Compatibility notice')]`
56+
);
57+
expect( compatibilityNoticeTitle.length ).toBe( 1 );
58+
} );
59+
} );
6460

6561
describe( 'once compatibility notice is dismissed', () => {
6662
beforeEach( async () => {

tests/e2e/utils.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ export async function insertBlockDontWaitForInsertClose( searchTerm ) {
2020
export const closeInserter = async () => {
2121
await page.click( '.edit-post-header [aria-label="Add block"]' );
2222
};
23-
24-
export const conditionalDescribe = ( condition ) => {
25-
return condition ? describe : describe.skip;
26-
};

0 commit comments

Comments
 (0)