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

Commit 65a44dd

Browse files
committed
test(isWindow): add tests for isWindow
1 parent 35358fd commit 65a44dd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/AngularSpec.js

+16
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,22 @@ describe('angular', function() {
886886
});
887887

888888

889+
describe('isWindow', function () {
890+
it('should return true for the Window object', function() {
891+
expect(isWindow(window)).toBe(true);
892+
});
893+
894+
it('should return false for any object that is not a Window', function() {
895+
expect(isWindow([])).toBe(false);
896+
expect(isWindow('')).toBeFalsy();
897+
expect(isWindow(23)).toBe(false);
898+
expect(isWindow({})).toBe(false);
899+
expect(isWindow(new Date())).toBe(false);
900+
expect(isWindow(document)).toBe(false);
901+
});
902+
});
903+
904+
889905
describe('compile', function() {
890906
it('should link to existing node and create scope', inject(function($rootScope, $compile) {
891907
var template = angular.element('<div>{{greeting = "hello world"}}</div>');

0 commit comments

Comments
 (0)