File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff 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>' ) ;
You can’t perform that action at this time.
0 commit comments