diff --git a/tests/e2e/specs/hello.test.js b/tests/e2e/specs/hello.test.js
index 038957883b..a567bb870d 100644
a
|
b
|
|
1 | | import { visitAdminPage } from '@wordpress/e2e-test-utils'; |
| 1 | import { visitAdminPage, createURL } from '@wordpress/e2e-test-utils'; |
2 | 2 | |
3 | 3 | describe( 'Hello World', () => { |
4 | 4 | it( 'Should load properly', async () => { |
… |
… |
describe( 'Hello World', () => { |
9 | 9 | expect( nodes.length ).not.toEqual( 0 ); |
10 | 10 | } ); |
11 | 11 | } ); |
| 12 | |
| 13 | describe( 'Admin Bar', () => { |
| 14 | it( 'Should show admin bar when user logged in' , async () => { |
| 15 | await visitAdminPage( '/' ); |
| 16 | const nodes = await page.$$( '#wpadminbar' ); |
| 17 | expect( nodes.length ).toBe( 1 ); |
| 18 | } ); |
| 19 | |
| 20 | it('Should not shows admin bar when logged out', async () => { |
| 21 | await page.hover( '#wp-admin-bar-my-account' ); |
| 22 | await page.waitForSelector( '#wp-admin-bar-logout', { visible: true } ); |
| 23 | await page.click( '#wp-admin-bar-logout a' ); |
| 24 | |
| 25 | const adminBar = await page.$( '#wpadminbar' ); |
| 26 | expect( adminBar ).toBeNull(); |
| 27 | }); |
| 28 | } ); |