@@ -67,31 +67,31 @@ describe('ThumbnailComponent', () => {
6767
6868 describe ( 'loading' , ( ) => {
6969 it ( 'should start out with isLoading$ true' , ( ) => {
70- expect ( comp . isLoading ) . toBeTrue ( ) ;
70+ expect ( comp . isLoading$ . getValue ( ) ) . toBeTrue ( ) ;
7171 } ) ;
7272
7373 it ( 'should set isLoading$ to false once an image is successfully loaded' , ( ) => {
7474 comp . setSrc ( 'http://bit.stream' ) ;
7575 fixture . debugElement . query ( By . css ( 'img.thumbnail-content' ) ) . triggerEventHandler ( 'load' , new Event ( 'load' ) ) ;
76- expect ( comp . isLoading ) . toBeFalse ( ) ;
76+ expect ( comp . isLoading$ . getValue ( ) ) . toBeFalse ( ) ;
7777 } ) ;
7878
7979 it ( 'should set isLoading$ to false once the src is set to null' , ( ) => {
8080 comp . setSrc ( null ) ;
81- expect ( comp . isLoading ) . toBeFalse ( ) ;
81+ expect ( comp . isLoading$ . getValue ( ) ) . toBeFalse ( ) ;
8282 } ) ;
8383
8484 it ( 'should show a loading animation while isLoading$ is true' , ( ) => {
8585 expect ( de . query ( By . css ( 'ds-themed-loading' ) ) ) . toBeTruthy ( ) ;
8686
87- comp . isLoading = false ;
87+ comp . isLoading$ . next ( false ) ;
8888 fixture . detectChanges ( ) ;
8989 expect ( fixture . debugElement . query ( By . css ( 'ds-themed-loading' ) ) ) . toBeFalsy ( ) ;
9090 } ) ;
9191
9292 describe ( 'with a thumbnail image' , ( ) => {
9393 beforeEach ( ( ) => {
94- comp . src = 'https://bit.stream' ;
94+ comp . src$ . next ( 'https://bit.stream' ) ;
9595 fixture . detectChanges ( ) ;
9696 } ) ;
9797
@@ -100,7 +100,7 @@ describe('ThumbnailComponent', () => {
100100 expect ( img ) . toBeTruthy ( ) ;
101101 expect ( img . classes [ 'd-none' ] ) . toBeTrue ( ) ;
102102
103- comp . isLoading = false ;
103+ comp . isLoading$ . next ( false ) ;
104104 fixture . detectChanges ( ) ;
105105 img = fixture . debugElement . query ( By . css ( 'img.thumbnail-content' ) ) ;
106106 expect ( img ) . toBeTruthy ( ) ;
@@ -111,14 +111,14 @@ describe('ThumbnailComponent', () => {
111111
112112 describe ( 'without a thumbnail image' , ( ) => {
113113 beforeEach ( ( ) => {
114- comp . src = null ;
114+ comp . src$ . next ( null ) ;
115115 fixture . detectChanges ( ) ;
116116 } ) ;
117117
118118 it ( 'should only show the HTML placeholder once done loading' , ( ) => {
119119 expect ( fixture . debugElement . query ( By . css ( 'div.thumbnail-placeholder' ) ) ) . toBeFalsy ( ) ;
120120
121- comp . isLoading = false ;
121+ comp . isLoading$ . next ( false ) ;
122122 fixture . detectChanges ( ) ;
123123 expect ( fixture . debugElement . query ( By . css ( 'div.thumbnail-placeholder' ) ) ) . toBeTruthy ( ) ;
124124 } ) ;
@@ -214,14 +214,14 @@ describe('ThumbnailComponent', () => {
214214 describe ( 'fallback' , ( ) => {
215215 describe ( 'if there is a default image' , ( ) => {
216216 it ( 'should display the default image' , ( ) => {
217- comp . src = 'http://bit.stream' ;
217+ comp . src$ . next ( 'http://bit.stream' ) ;
218218 comp . defaultImage = 'http://default.img' ;
219219 comp . errorHandler ( ) ;
220- expect ( comp . src ) . toBe ( comp . defaultImage ) ;
220+ expect ( comp . src$ . getValue ( ) ) . toBe ( comp . defaultImage ) ;
221221 } ) ;
222222
223223 it ( 'should include the alt text' , ( ) => {
224- comp . src = 'http://bit.stream' ;
224+ comp . src$ . next ( 'http://bit.stream' ) ;
225225 comp . defaultImage = 'http://default.img' ;
226226 comp . errorHandler ( ) ;
227227
@@ -233,10 +233,10 @@ describe('ThumbnailComponent', () => {
233233
234234 describe ( 'if there is no default image' , ( ) => {
235235 it ( 'should display the HTML placeholder' , ( ) => {
236- comp . src = 'http://default.img' ;
236+ comp . src$ . next ( 'http://default.img' ) ;
237237 comp . defaultImage = null ;
238238 comp . errorHandler ( ) ;
239- expect ( comp . src ) . toBe ( null ) ;
239+ expect ( comp . src$ . getValue ( ) ) . toBe ( null ) ;
240240
241241 fixture . detectChanges ( ) ;
242242 const placeholder = fixture . debugElement . query ( By . css ( 'div.thumbnail-placeholder' ) ) . nativeElement ;
@@ -328,7 +328,7 @@ describe('ThumbnailComponent', () => {
328328 it ( 'should show the default image' , ( ) => {
329329 comp . defaultImage = 'default/image.jpg' ;
330330 comp . ngOnChanges ( { } ) ;
331- expect ( comp . src ) . toBe ( 'default/image.jpg' ) ;
331+ expect ( comp . src$ . getValue ( ) ) . toBe ( 'default/image.jpg' ) ;
332332 } ) ;
333333 } ) ;
334334 } ) ;
0 commit comments