Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
Fix Test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgusDark committed Jun 10, 2017
1 parent 2202998 commit d09bdd0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/elements/Image.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import { Image } from './../../src/elements/Image';

describe('Image', () => {
it('should render a figure with .image', () => {
const component = shallow(<Image>My Image</Image>);
expect(component.contains(<figure className='image'>My Image</figure>)).toBe(true);
const component = shallow(<Image src='something' />);
expect(component.is('figure')).toBe(true);
expect(component.hasClass('image')).toBe(true);
expect(component.children().is('img')).toBe(true);
expect(component.children().contains(<img src='something' />)).toBe(true);
});

it('should render a figure with .image and Square modifiers', () => {
Expand Down
13 changes: 13 additions & 0 deletions test/grid/Tile.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ import { shallow } from 'enzyme';
import { Tile } from './../../src/grid/Tile';

describe('Tile', () => {
it('should render a custom component with Tile props', () => {
const customComponent = (props) => (
<div {...props}> My Tile </div>
);

const customComponentRendered = (
<div className='tile'> My Tile </div>
);

const component = shallow(<Tile render={customComponent} />);
expect(component.contains(customComponentRendered)).toBe(true);
});

it('should render a div with .tile', () => {
const component = shallow(<Tile>Any Content</Tile>);
expect(component.contains(<div className='tile'>Any Content</div>)).toBe(true);
Expand Down

0 comments on commit d09bdd0

Please sign in to comment.