|
1 | | -/* global describe, it */ |
2 | | -/* eslint react/prefer-stateless-function: 0 */ |
3 | | - |
4 | | -import { React, TestUtils, expect } from './helpers' |
| 1 | +import React from 'react' |
5 | 2 | import loopable from '../src/loop' |
6 | 3 |
|
7 | 4 | describe('Loopable', () => { |
8 | | - it('should return first-child if first', () => { |
9 | | - expect(loopable(0, 4)).to.eql({ 'first-child': true, 'nth-child': 0, 'even': true }) |
| 5 | + test('should return first-child if first', () => { |
| 6 | + expect(loopable(0, 4)).toEqual({ 'first-child': true, 'nth-child': 0, 'even': true }) |
10 | 7 | }) |
11 | 8 |
|
12 | | - it('should return last-child if last', () => { |
13 | | - expect(loopable(3, 4)).to.eql({ 'last-child': true, 'nth-child': 3, 'odd': true }) |
| 9 | + test('should return last-child if last', () => { |
| 10 | + expect(loopable(3, 4)).toEqual({ 'last-child': true, 'nth-child': 3, 'odd': true }) |
14 | 11 | }) |
15 | 12 |
|
16 | | - it('should return even if even', () => { |
17 | | - expect(loopable(2, 4)).to.eql({ 'even': true, 'nth-child': 2 }) |
| 13 | + test('should return even if even', () => { |
| 14 | + expect(loopable(2, 4)).toEqual({ 'even': true, 'nth-child': 2 }) |
18 | 15 | }) |
19 | 16 |
|
20 | | - it('should return odd if odd', () => { |
21 | | - expect(loopable(1, 4)).to.eql({ 'odd': true, 'nth-child': 1 }) |
| 17 | + test('should return odd if odd', () => { |
| 18 | + expect(loopable(1, 4)).toEqual({ 'odd': true, 'nth-child': 1 }) |
22 | 19 | }) |
23 | 20 |
|
24 | | - it('should return simple css', () => { |
25 | | - class Component extends React.Component { |
26 | | - render() { |
27 | | - return <div className="body" /> |
28 | | - } |
29 | | - } |
30 | | - const component = TestUtils.renderIntoDocument(<Component { ...loopable(3, 4) } />) |
31 | | - expect(component.props).to.eql({ 'last-child': true, 'nth-child': 3, 'odd': true }) |
| 21 | + test('should return simple css', () => { |
| 22 | + const Component = () => <div className="body" /> |
| 23 | + const rendered = <Component { ...loopable(3, 4) } /> |
| 24 | + expect(rendered.props).toEqual({ 'last-child': true, 'nth-child': 3, 'odd': true }) |
32 | 25 | }) |
33 | 26 | }) |
0 commit comments