Skip to content

Commit

Permalink
Editor: Update and migrate editor component tests to single runner
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Apr 6, 2016
1 parent 6d14920 commit 667871a
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 283 deletions.
7 changes: 0 additions & 7 deletions client/post-editor/editor-discussion/Makefile

This file was deleted.

44 changes: 19 additions & 25 deletions client/post-editor/editor-discussion/test/index.jsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
/* eslint-disable vars-on-top */
require( 'lib/react-test-env-setup' )();

/**
* External dependencies
*/
var ReactDom = require( 'react-dom' ),
React = require( 'react' ),
TestUtils = require( 'react-addons-test-utils' ),
sinon = require( 'sinon' ),
sinonChai = require( 'sinon-chai' ),
mockery = require( 'mockery' ),
chai = require( 'chai' ),
noop = require( 'lodash/noop' ),
expect = chai.expect;

chai.use( sinonChai );
const MOCK_COMPONENT = React.createClass( {
render: function() {
return null;
}
} );
import ReactDom from 'react-dom';
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import sinon from 'sinon';
import mockery from 'mockery';
import { expect } from 'chai';
import noop from 'lodash/noop';

/**
* Internal dependencies
*/
import EmptyComponent from 'test/helpers/react/empty-component';
import useMockery from 'test/helpers/use-mockery';
import useFakeDom from 'test/helpers/use-fake-dom';

/**
* Module variables
*/
var DUMMY_SITE = {
const DUMMY_SITE = {
options: {
default_comment_status: true,
default_ping_status: false
Expand All @@ -34,13 +29,12 @@ var DUMMY_SITE = {
describe( 'EditorDiscussion', function() {
var editPost, EditorDiscussion;

useMockery();
useFakeDom();

before( function() {
mockery.enable( {
warnOnReplace: false,
warnOnUnregistered: false
} );
editPost = sinon.spy();
mockery.registerMock( 'components/info-popover', MOCK_COMPONENT );
mockery.registerMock( 'components/info-popover', EmptyComponent );
mockery.registerMock( 'lib/posts/actions', {
edit: editPost
} );
Expand Down
10 changes: 0 additions & 10 deletions client/post-editor/editor-ground-control/Makefile

This file was deleted.

Loading

0 comments on commit 667871a

Please sign in to comment.