From 894904554fca38bf950f479f1b7265680bb057a6 Mon Sep 17 00:00:00 2001 From: Naoufal Kadhom Date: Fri, 29 May 2015 21:47:06 -0400 Subject: [PATCH] add element and mixin tests --- src/__tests__/index-test.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/__tests__/index-test.js b/src/__tests__/index-test.js index e3c5075..5d392ce 100644 --- a/src/__tests__/index-test.js +++ b/src/__tests__/index-test.js @@ -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 */ + + /*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(); + }); }); +