@@ -15,8 +15,8 @@ describe('$mdToast service', function() {
1515 } ) ) ;
1616
1717 function setup ( options ) {
18- var promise ;
19- inject ( function ( $mdToast , $material , $timeout ) {
18+ var promise = null ;
19+ inject ( function ( $mdToast , $material ) {
2020 options = options || { } ;
2121 promise = $mdToast . show ( options ) ;
2222 $material . flushOutstandingAnimations ( ) ;
@@ -26,15 +26,15 @@ describe('$mdToast service', function() {
2626
2727 describe ( 'simple()' , function ( ) {
2828
29- hasConfigMethods ( [ 'content ' , 'action' , 'capsule' , 'highlightAction' , 'theme' , 'toastClass' ] ) ;
29+ hasConfigMethods ( [ 'textContent ' , 'action' , 'capsule' , 'highlightAction' , 'theme' , 'toastClass' ] ) ;
3030
3131 it ( 'should have `._md` class indicator' , inject ( function ( $mdToast , $material ) {
3232 var parent = angular . element ( '<div>' ) ;
3333
3434 $mdToast . show (
3535 $mdToast . simple ( {
3636 parent : parent ,
37- content : 'Do something' ,
37+ textContent : 'Do something' ,
3838 theme : 'some-theme' ,
3939 capsule : true
4040 } ) ) ;
@@ -43,18 +43,18 @@ describe('$mdToast service', function() {
4343 expect ( parent . find ( 'md-toast' ) . hasClass ( '_md' ) ) . toBe ( true ) ;
4444 } ) ) ;
4545
46- it ( 'supports a basic toast' , inject ( function ( $mdToast , $rootScope , $timeout , $material , $browser ) {
47- var openAndclosed = false ;
46+ it ( 'supports a basic toast' , inject ( function ( $mdToast , $rootScope , $timeout , $material ) {
47+ var openAndClosed = false ;
4848 var parent = angular . element ( '<div>' ) ;
4949 $mdToast . show (
5050 $mdToast . simple ( {
5151 parent : parent ,
52- content : 'Do something' ,
52+ textContent : 'Do something' ,
5353 theme : 'some-theme' ,
5454 capsule : true
5555 } )
5656 ) . then ( function ( ) {
57- openAndclosed = true ;
57+ openAndClosed = true ;
5858 } ) ;
5959
6060 $material . flushOutstandingAnimations ( ) ;
@@ -66,11 +66,10 @@ describe('$mdToast service', function() {
6666
6767 $material . flushInterimElement ( ) ;
6868
69- expect ( openAndclosed ) . toBe ( true ) ;
69+ expect ( openAndClosed ) . toBe ( true ) ;
7070 } ) ) ;
7171
7272 it ( 'supports dynamically updating the content' , inject ( function ( $mdToast , $rootScope , $rootElement ) {
73- var parent = angular . element ( '<div>' ) ;
7473 $mdToast . showSimple ( 'Hello world' ) ;
7574 $rootScope . $digest ( ) ;
7675 $mdToast . updateTextContent ( 'Goodbye world' ) ;
@@ -83,7 +82,7 @@ describe('$mdToast service', function() {
8382 var parent = angular . element ( '<div>' ) ;
8483 $mdToast . show (
8584 $mdToast . simple ( {
86- content : 'Do something' ,
85+ textContent : 'Do something' ,
8786 parent : parent
8887 } )
8988 . action ( 'Click me' )
@@ -104,7 +103,7 @@ describe('$mdToast service', function() {
104103
105104 $mdToast . show (
106105 $mdToast . simple ( {
107- content : 'Marked as read' ,
106+ textContent : 'Marked as read' ,
108107 parent : parent
109108 } )
110109 . action ( 'UNDO' )
@@ -142,7 +141,7 @@ describe('$mdToast service', function() {
142141 it ( 'displays correctly' , inject ( function ( $mdToast , $rootScope ) {
143142 var parent = angular . element ( '<div>' ) ;
144143 var toast = $mdToast . simple ( {
145- content : 'Do something' ,
144+ textContent : 'Do something' ,
146145 parent : parent
147146 } ) . action ( 'Click me' ) ;
148147
@@ -160,7 +159,7 @@ describe('$mdToast service', function() {
160159 it ( 'displays correctly with parent()' , inject ( function ( $mdToast , $rootScope ) {
161160 var parent = angular . element ( '<div>' ) ;
162161 var toast = $mdToast . simple ( {
163- content : 'Do something' ,
162+ textContent : 'Do something' ,
164163 } )
165164 . parent ( parent )
166165 . action ( 'Click me' ) ;
@@ -334,7 +333,6 @@ describe('$mdToast service', function() {
334333 it ( 'after duration' , inject ( function ( $timeout , $animate , $rootElement ) {
335334 disableAnimations ( ) ;
336335
337- var parent = angular . element ( '<div>' ) ;
338336 var hideDelay = 1234 ;
339337 setup ( {
340338 template : '<md-toast />' ,
@@ -348,7 +346,7 @@ describe('$mdToast service', function() {
348346 it ( 'and resolve with default `true`' , inject ( function ( $timeout , $material , $mdToast ) {
349347 disableAnimations ( ) ;
350348
351- var hideDelay = 1234 , result , fault ;
349+ var result = null , fault = null ;
352350 setup ( {
353351 template : '<md-toast />' ,
354352 hideDelay : 1234
@@ -361,15 +359,14 @@ describe('$mdToast service', function() {
361359
362360 $material . flushInterimElement ( ) ;
363361
364- expect ( result ) . toBe ( undefined ) ;
365- expect ( angular . isUndefined ( fault ) ) . toBe ( true ) ;
366-
362+ expect ( angular . isUndefined ( result ) ) . toBe ( true ) ;
363+ expect ( fault ) . toBe ( null ) ;
367364 } ) ) ;
368365
369366 it ( 'and resolve with specified value' , inject ( function ( $timeout , $animate , $material , $mdToast ) {
370367 disableAnimations ( ) ;
371368
372- var hideDelay = 1234 , result , fault ;
369+ var result = null , fault = null ;
373370 setup ( {
374371 template : '<md-toast />' ,
375372 hideDelay : 1234
@@ -383,14 +380,13 @@ describe('$mdToast service', function() {
383380 $material . flushInterimElement ( ) ;
384381
385382 expect ( result ) . toBe ( "secret" ) ;
386- expect ( angular . isUndefined ( fault ) ) . toBe ( true ) ;
387-
383+ expect ( fault ) . toBe ( null ) ;
388384 } ) ) ;
389385
390386 it ( 'and resolve `true` after timeout' , inject ( function ( $timeout , $material ) {
391387 disableAnimations ( ) ;
392388
393- var hideDelay = 1234 , result , fault ;
389+ var result = null , fault = null ;
394390 setup ( {
395391 template : '<md-toast />' ,
396392 hideDelay : 1234
@@ -401,17 +397,16 @@ describe('$mdToast service', function() {
401397
402398 $material . flushInterimElement ( ) ;
403399
404- expect ( result ) . toBe ( undefined ) ;
405- expect ( angular . isUndefined ( fault ) ) . toBe ( true ) ;
406-
400+ expect ( angular . isUndefined ( result ) ) . toBe ( true ) ;
401+ expect ( fault ) . toBe ( null ) ;
407402 } ) ) ;
408403
409- it ( 'and resolve `ok` with click on OK button' , inject ( function ( $mdToast , $rootScope , $timeout , $material , $browser ) {
410- var result , fault ;
404+ it ( 'and resolve `ok` with click on OK button' , inject ( function ( $mdToast , $rootScope , $timeout , $material ) {
405+ var result = null , fault = null ;
411406 var parent = angular . element ( '<div>' ) ;
412407 var toast = $mdToast . simple ( {
413408 parent : parent ,
414- content : 'Do something'
409+ textContent : 'Do something'
415410 } ) . action ( 'Close with "ok" response' ) ;
416411
417412 $mdToast
@@ -428,7 +423,7 @@ describe('$mdToast service', function() {
428423 $material . flushInterimElement ( ) ;
429424
430425 expect ( result ) . toBe ( 'ok' ) ;
431- expect ( angular . isUndefined ( fault ) ) . toBe ( true ) ;
426+ expect ( fault ) . toBe ( null ) ;
432427 } ) ) ;
433428 } ) ;
434429
0 commit comments