Skip to content

Commit

Permalink
Notify rendered in Jest
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Feb 4, 2017
1 parent d99a17c commit 271d5b8
Show file tree
Hide file tree
Showing 32 changed files with 64 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import load from 'absoluteLoad'

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import NodePath from './NodePath';
describe('NODE_PATH', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<NodePath />, div);
return new Promise(resolve => {
ReactDOM.render(<NodePath notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load() {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import ArrayDestructuring from './ArrayDestructuring';
describe('array destructuring', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<ArrayDestructuring />, div);
return new Promise(resolve => {
ReactDOM.render(<ArrayDestructuring notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load(users) {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import ArraySpread from './ArraySpread';
describe('array spread', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<ArraySpread />, div);
return new Promise(resolve => {
ReactDOM.render(<ArraySpread notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ async function load() {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import AsyncAwait from './AsyncAwait';
describe('async/await', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<AsyncAwait />, div);
return new Promise(resolve => {
ReactDOM.render(<AsyncAwait notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import React, { Component, PropTypes } from 'react'

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

users = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import ClassProperties from './ClassProperties';
describe('class properties', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<ClassProperties />, div);
return new Promise(resolve => {
ReactDOM.render(<ClassProperties notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load(prefix) {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import ComputedProperties from './ComputedProperties';
describe('computed properties', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<ComputedProperties />, div);
return new Promise(resolve => {
ReactDOM.render(<ComputedProperties notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ function load() {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import CustomInterpolation from './CustomInterpolation';
describe('custom interpolation', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<CustomInterpolation />, div);
return new Promise(resolve => {
ReactDOM.render(<CustomInterpolation notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load(id = 0) {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import DefaultParameters from './DefaultParameters';
describe('default parameters', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<DefaultParameters />, div);
return new Promise(resolve => {
ReactDOM.render(<DefaultParameters notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ async function load() {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import DestructuringAndAwait from './DestructuringAndAwait';
describe('destructuring and await', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<DestructuringAndAwait />, div);
return new Promise(resolve => {
ReactDOM.render(<DestructuringAndAwait notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ function * load(limit) {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Generators from './Generators';
describe('generators', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Generators />, div);
return new Promise(resolve => {
ReactDOM.render(<Generators notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load() {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import ObjectDestructuring from './ObjectDestructuring';
describe('object destructuring', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<ObjectDestructuring />, div);
return new Promise(resolve => {
ReactDOM.render(<ObjectDestructuring notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load(baseUser) {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import ObjectSpread from './ObjectSpread';
describe('object spread', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<ObjectSpread />, div);
return new Promise(resolve => {
ReactDOM.render(<ObjectSpread notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load() {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Promises from './Promises';
describe('promises', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Promises />, div);
return new Promise(resolve => {
ReactDOM.render(<Promises notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load({ id, ...rest } = { id: 0, user: { id: 42, name: '42' } }) {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import RestAndDefault from './RestAndDefault';
describe('rest + default', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<RestAndDefault />, div);
return new Promise(resolve => {
ReactDOM.render(<RestAndDefault notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load({ id = 0, ...rest }) {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import RestParameters from './RestParameters';
describe('rest parameters', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<RestParameters />, div);
return new Promise(resolve => {
ReactDOM.render(<RestParameters notifyRendered={resolve} />, div);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function load(name) {

export default class extends Component {
static propTypes = {
notifyRendered: PropTypes.func
}

static defaultProps = {
notifyRendered: () => {}
notifyRendered: PropTypes.func.isRequired
}

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import TemplateInterpolation from './TemplateInterpolation';
describe('template interpolation', () => {
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<TemplateInterpolation />, div);
return new Promise(resolve => {
ReactDOM.render(<TemplateInterpolation notifyRendered={resolve} />, div);
});
});
});

0 comments on commit 271d5b8

Please sign in to comment.