WordPress.org

Make WordPress Core

Ticket #48978: 48978.patch

File 48978.patch, 874 bytes (added by hideokamoto, 6 months ago)

To add the test case

  • tests/e2e/specs/hello.test.js

    diff --git tests/e2e/specs/hello.test.js tests/e2e/specs/hello.test.js
    index 038957883b..0d5e2b6248 100644
     
    1 import { visitAdminPage } from '@wordpress/e2e-test-utils';
     1import { visitAdminPage, createURL } from '@wordpress/e2e-test-utils';
     2import { loginUser } from '@wordpress/e2e-test-utils/build/login-user';
    23
    34describe( 'Hello World', () => {
    45        it( 'Should load properly', async () => {
    describe( 'Hello World', () => { 
    910                expect( nodes.length ).not.toEqual( 0 );
    1011        } );
    1112} );
     13describe( 'Login User', () => {
     14        it( 'Should show admin bar when user logged in' , async () => {
     15                await loginUser()
     16                await page.goto( createURL( '/' ) )
     17                const nodes = await page.$( '#wpadminbar' )
     18                expect( nodes.length ).not.toEqual( 0 );
     19        } )
     20} )
     21 No newline at end of file