@@ -73,31 +73,31 @@ describe('ThumbnailComponent', () => {
7373
7474 describe ( 'loading' , ( ) => {
7575 it ( 'should start out with isLoading$ true' , ( ) => {
76- expect ( comp . isLoading ) . toBeTrue ( ) ;
76+ expect ( comp . isLoading$ . getValue ( ) ) . toBeTrue ( ) ;
7777 } ) ;
7878
7979 it ( 'should set isLoading$ to false once an image is successfully loaded' , ( ) => {
8080 comp . setSrc ( 'http://bit.stream' ) ;
8181 fixture . debugElement . query ( By . css ( 'img.thumbnail-content' ) ) . triggerEventHandler ( 'load' , new Event ( 'load' ) ) ;
82- expect ( comp . isLoading ) . toBeFalse ( ) ;
82+ expect ( comp . isLoading$ . getValue ( ) ) . toBeFalse ( ) ;
8383 } ) ;
8484
8585 it ( 'should set isLoading$ to false once the src is set to null' , ( ) => {
8686 comp . setSrc ( null ) ;
87- expect ( comp . isLoading ) . toBeFalse ( ) ;
87+ expect ( comp . isLoading$ . getValue ( ) ) . toBeFalse ( ) ;
8888 } ) ;
8989
9090 it ( 'should show a loading animation while isLoading$ is true' , ( ) => {
9191 expect ( de . query ( By . css ( 'ds-themed-loading' ) ) ) . toBeTruthy ( ) ;
9292
93- comp . isLoading = false ;
93+ comp . isLoading$ . next ( false ) ;
9494 fixture . detectChanges ( ) ;
9595 expect ( fixture . debugElement . query ( By . css ( 'ds-themed-loading' ) ) ) . toBeFalsy ( ) ;
9696 } ) ;
9797
9898 describe ( 'with a thumbnail image' , ( ) => {
9999 beforeEach ( ( ) => {
100- comp . src = 'https://bit.stream' ;
100+ comp . src$ . next ( 'https://bit.stream' ) ;
101101 fixture . detectChanges ( ) ;
102102 } ) ;
103103
@@ -106,7 +106,7 @@ describe('ThumbnailComponent', () => {
106106 expect ( img ) . toBeTruthy ( ) ;
107107 expect ( img . classes [ 'd-none' ] ) . toBeTrue ( ) ;
108108
109- comp . isLoading = false ;
109+ comp . isLoading$ . next ( false ) ;
110110 fixture . detectChanges ( ) ;
111111 img = fixture . debugElement . query ( By . css ( 'img.thumbnail-content' ) ) ;
112112 expect ( img ) . toBeTruthy ( ) ;
@@ -117,14 +117,14 @@ describe('ThumbnailComponent', () => {
117117
118118 describe ( 'without a thumbnail image' , ( ) => {
119119 beforeEach ( ( ) => {
120- comp . src = null ;
120+ comp . src$ . next ( null ) ;
121121 fixture . detectChanges ( ) ;
122122 } ) ;
123123
124124 it ( 'should only show the HTML placeholder once done loading' , ( ) => {
125125 expect ( fixture . debugElement . query ( By . css ( 'div.thumbnail-placeholder' ) ) ) . toBeFalsy ( ) ;
126126
127- comp . isLoading = false ;
127+ comp . isLoading$ . next ( false ) ;
128128 fixture . detectChanges ( ) ;
129129 expect ( fixture . debugElement . query ( By . css ( 'div.thumbnail-placeholder' ) ) ) . toBeTruthy ( ) ;
130130 } ) ;
@@ -220,14 +220,14 @@ describe('ThumbnailComponent', () => {
220220 describe ( 'fallback' , ( ) => {
221221 describe ( 'if there is a default image' , ( ) => {
222222 it ( 'should display the default image' , ( ) => {
223- comp . src = 'http://bit.stream' ;
223+ comp . src$ . next ( 'http://bit.stream' ) ;
224224 comp . defaultImage = 'http://default.img' ;
225225 comp . errorHandler ( ) ;
226- expect ( comp . src ) . toBe ( comp . defaultImage ) ;
226+ expect ( comp . src$ . getValue ( ) ) . toBe ( comp . defaultImage ) ;
227227 } ) ;
228228
229229 it ( 'should include the alt text' , ( ) => {
230- comp . src = 'http://bit.stream' ;
230+ comp . src$ . next ( 'http://bit.stream' ) ;
231231 comp . defaultImage = 'http://default.img' ;
232232 comp . errorHandler ( ) ;
233233
@@ -239,10 +239,10 @@ describe('ThumbnailComponent', () => {
239239
240240 describe ( 'if there is no default image' , ( ) => {
241241 it ( 'should display the HTML placeholder' , ( ) => {
242- comp . src = 'http://default.img' ;
242+ comp . src$ . next ( 'http://default.img' ) ;
243243 comp . defaultImage = null ;
244244 comp . errorHandler ( ) ;
245- expect ( comp . src ) . toBe ( null ) ;
245+ expect ( comp . src$ . getValue ( ) ) . toBe ( null ) ;
246246
247247 fixture . detectChanges ( ) ;
248248 const placeholder = fixture . debugElement . query ( By . css ( 'div.thumbnail-placeholder' ) ) . nativeElement ;
@@ -334,7 +334,7 @@ describe('ThumbnailComponent', () => {
334334 it ( 'should show the default image' , ( ) => {
335335 comp . defaultImage = 'default/image.jpg' ;
336336 comp . ngOnChanges ( { } ) ;
337- expect ( comp . src ) . toBe ( 'default/image.jpg' ) ;
337+ expect ( comp . src$ . getValue ( ) ) . toBe ( 'default/image.jpg' ) ;
338338 } ) ;
339339 } ) ;
340340 } ) ;
@@ -382,7 +382,7 @@ describe('ThumbnailComponent', () => {
382382 } ) ;
383383
384384 it ( 'should start out with isLoading$ true' , ( ) => {
385- expect ( comp . isLoading ) . toBeTrue ( ) ;
385+ expect ( comp . isLoading$ . getValue ( ) ) . toBeTrue ( ) ;
386386 expect ( de . query ( By . css ( 'ds-themed-loading' ) ) ) . toBeTruthy ( ) ;
387387 } ) ;
388388
0 commit comments