Skip to content

Commit

Permalink
chore: PR Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tofumatt committed Sep 4, 2018
1 parent 3d26b06 commit a901273
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 39 deletions.
5 changes: 2 additions & 3 deletions packages/editor/src/components/post-title/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import React from 'react';
import Textarea from 'react-autosize-textarea';
import classnames from 'classnames';
import { get } from 'lodash';
Expand All @@ -10,7 +9,7 @@ import { get } from 'lodash';
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { Component, createRef } from '@wordpress/element';
import { decodeEntities } from '@wordpress/html-entities';
import { ENTER } from '@wordpress/keycodes';
import { withSelect, withDispatch } from '@wordpress/data';
Expand All @@ -37,7 +36,7 @@ class PostTitle extends Component {
this.onUnselect = this.onUnselect.bind( this );
this.onKeyDown = this.onKeyDown.bind( this );
this.redirectHistory = this.redirectHistory.bind( this );
this.textareaRef = React.createRef();
this.textareaRef = createRef();

this.state = {
isSelected: false,
Expand Down
31 changes: 0 additions & 31 deletions test/e2e/specs/hello.test.js

This file was deleted.

29 changes: 24 additions & 5 deletions test/e2e/specs/new-post.test.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
/**
* Internal dependencies
*/
import {
newPost,
} from '../support/utils';
import { newPost } from '../support/utils';

describe( 'new post', () => {
beforeEach( async () => {
describe( 'new editor state', () => {
beforeAll( async () => {
await newPost();
} );

it( 'should show the New Post page in Gutenberg', async () => {
expect( page.url() ).toEqual( expect.stringContaining( 'post-new.php' ) );
// Should display the title.
const title = await page.$( '[placeholder="Add title"]' );
expect( title ).not.toBeNull();
// Should display the Preview button.
const postPreviewButton = await page.$( '.editor-post-preview.components-button' );
expect( postPreviewButton ).not.toBeNull();
// Should display the Post Formats UI.
const postFormatsUi = await page.$( '.editor-post-format' );
expect( postFormatsUi ).not.toBeNull();
} );

it( 'should have no history', async () => {
const undoButton = await page.$( '.editor-history__undo:not( :disabled )' );
const redoButton = await page.$( '.editor-history__redo:not( :disabled )' );

expect( undoButton ).toBeNull();
expect( redoButton ).toBeNull();
} );

it( 'should focus the title if the title is empty', async () => {
const activeElementClasses = await page.evaluate( () => {
return Object.values( document.activeElement.classList );
Expand Down

0 comments on commit a901273

Please sign in to comment.