Skip to content

Commit

Permalink
add element and mixin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
naoufal committed May 30, 2015
1 parent acf5a3f commit 8949045
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/__tests__/index-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
jest.dontMock('../index');

var React = require('react/addons');
var TestUtils = React.addons.TestUtils;
var ProgressHUD = require('../index');

describe('ProgressHUD', function() {
it('should be a ReactElement', function() {
var is_element = TestUtils.isElement(
/*jshint ignore:start */
<ProgressHUD isVisible={false}/>
/*jshint ignore:end */
);

expect(is_element).toBe(true);
});

it('should not be dismissible by default', function() {
expect(ProgressHUD.defaultProps.isDismissible).toBe(false);
});

it('should default to a black spinner', function() {
expect(ProgressHUD.defaultProps.color).toBe('#000');
});

it('should default to a transparent overlay', function() {
expect(ProgressHUD.defaultProps.overlayColor).toBe('rgba(0, 0, 0, 0)');
});
});

describe('Mixin', function() {
it('should expose a Mixin', function() {
expect(ProgressHUD.Mixin).toBeTruthy();
});

it('should expose a showProgressHUD method', function() {
expect(ProgressHUD.Mixin.showProgressHUD).toBeTruthy();
});

it('should expose a dismissProgressHUD method', function() {
expect(ProgressHUD.Mixin.dismissProgressHUD).toBeTruthy();
});
});

0 comments on commit 8949045

Please sign in to comment.