Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
test(isWindow): add tests for isWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
rodyhaddad committed Jun 13, 2014
1 parent 35358fd commit 65a44dd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/AngularSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,22 @@ describe('angular', function() {
});


describe('isWindow', function () {
it('should return true for the Window object', function() {
expect(isWindow(window)).toBe(true);
});

it('should return false for any object that is not a Window', function() {
expect(isWindow([])).toBe(false);
expect(isWindow('')).toBeFalsy();
expect(isWindow(23)).toBe(false);
expect(isWindow({})).toBe(false);
expect(isWindow(new Date())).toBe(false);
expect(isWindow(document)).toBe(false);
});
});


describe('compile', function() {
it('should link to existing node and create scope', inject(function($rootScope, $compile) {
var template = angular.element('<div>{{greeting = "hello world"}}</div>');
Expand Down

0 comments on commit 65a44dd

Please sign in to comment.