@@ -100,31 +100,31 @@ describe('ThumbnailComponent', () => {
100100
101101 describe ( 'loading' , ( ) => {
102102 it ( 'should start out with isLoading$ true' , ( ) => {
103- expect ( comp . isLoading ) . toBeTrue ( ) ;
103+ expect ( comp . isLoading$ . getValue ( ) ) . toBeTrue ( ) ;
104104 } ) ;
105105
106106 it ( 'should set isLoading$ to false once an image is successfully loaded' , ( ) => {
107107 comp . setSrc ( 'http://bit.stream' ) ;
108108 fixture . debugElement . query ( By . css ( 'img.thumbnail-content' ) ) . triggerEventHandler ( 'load' , new Event ( 'load' ) ) ;
109- expect ( comp . isLoading ) . toBeFalse ( ) ;
109+ expect ( comp . isLoading$ . getValue ( ) ) . toBeFalse ( ) ;
110110 } ) ;
111111
112112 it ( 'should set isLoading$ to false once the src is set to null' , ( ) => {
113113 comp . setSrc ( null ) ;
114- expect ( comp . isLoading ) . toBeFalse ( ) ;
114+ expect ( comp . isLoading$ . getValue ( ) ) . toBeFalse ( ) ;
115115 } ) ;
116116
117117 it ( 'should show a loading animation while isLoading$ is true' , ( ) => {
118118 expect ( de . query ( By . css ( 'ds-loading' ) ) ) . toBeTruthy ( ) ;
119119
120- comp . isLoading = false ;
120+ comp . isLoading$ . next ( false ) ;
121121 fixture . detectChanges ( ) ;
122122 expect ( fixture . debugElement . query ( By . css ( 'ds-loading' ) ) ) . toBeFalsy ( ) ;
123123 } ) ;
124124
125125 describe ( 'with a thumbnail image' , ( ) => {
126126 beforeEach ( ( ) => {
127- comp . src = 'https://bit.stream' ;
127+ comp . src$ . next ( 'https://bit.stream' ) ;
128128 fixture . detectChanges ( ) ;
129129 } ) ;
130130
@@ -133,7 +133,7 @@ describe('ThumbnailComponent', () => {
133133 expect ( img ) . toBeTruthy ( ) ;
134134 expect ( img . classes [ 'd-none' ] ) . toBeTrue ( ) ;
135135
136- comp . isLoading = false ;
136+ comp . isLoading$ . next ( false ) ;
137137 fixture . detectChanges ( ) ;
138138 img = fixture . debugElement . query ( By . css ( 'img.thumbnail-content' ) ) ;
139139 expect ( img ) . toBeTruthy ( ) ;
@@ -144,14 +144,14 @@ describe('ThumbnailComponent', () => {
144144
145145 describe ( 'without a thumbnail image' , ( ) => {
146146 beforeEach ( ( ) => {
147- comp . src = null ;
147+ comp . src$ . next ( null ) ;
148148 fixture . detectChanges ( ) ;
149149 } ) ;
150150
151151 it ( 'should only show the HTML placeholder once done loading' , ( ) => {
152152 expect ( fixture . debugElement . query ( By . css ( 'div.thumbnail-placeholder' ) ) ) . toBeFalsy ( ) ;
153153
154- comp . isLoading = false ;
154+ comp . isLoading$ . next ( false ) ;
155155 fixture . detectChanges ( ) ;
156156 expect ( fixture . debugElement . query ( By . css ( 'div.thumbnail-placeholder' ) ) ) . toBeTruthy ( ) ;
157157 } ) ;
@@ -247,14 +247,14 @@ describe('ThumbnailComponent', () => {
247247 describe ( 'fallback' , ( ) => {
248248 describe ( 'if there is a default image' , ( ) => {
249249 it ( 'should display the default image' , ( ) => {
250- comp . src = 'http://bit.stream' ;
250+ comp . src$ . next ( 'http://bit.stream' ) ;
251251 comp . defaultImage = 'http://default.img' ;
252252 comp . errorHandler ( ) ;
253- expect ( comp . src ) . toBe ( comp . defaultImage ) ;
253+ expect ( comp . src$ . getValue ( ) ) . toBe ( comp . defaultImage ) ;
254254 } ) ;
255255
256256 it ( 'should include the alt text' , ( ) => {
257- comp . src = 'http://bit.stream' ;
257+ comp . src$ . next ( 'http://bit.stream' ) ;
258258 comp . defaultImage = 'http://default.img' ;
259259 comp . errorHandler ( ) ;
260260
@@ -266,10 +266,10 @@ describe('ThumbnailComponent', () => {
266266
267267 describe ( 'if there is no default image' , ( ) => {
268268 it ( 'should display the HTML placeholder' , ( ) => {
269- comp . src = 'http://default.img' ;
269+ comp . src$ . next ( 'http://default.img' ) ;
270270 comp . defaultImage = null ;
271271 comp . errorHandler ( ) ;
272- expect ( comp . src ) . toBe ( null ) ;
272+ expect ( comp . src$ . getValue ( ) ) . toBe ( null ) ;
273273
274274 fixture . detectChanges ( ) ;
275275 const placeholder = fixture . debugElement . query ( By . css ( 'div.thumbnail-placeholder' ) ) . nativeElement ;
@@ -361,7 +361,7 @@ describe('ThumbnailComponent', () => {
361361 it ( 'should show the default image' , ( ) => {
362362 comp . defaultImage = 'default/image.jpg' ;
363363 comp . ngOnChanges ( { } ) ;
364- expect ( comp . src ) . toBe ( 'default/image.jpg' ) ;
364+ expect ( comp . src$ . getValue ( ) ) . toBe ( 'default/image.jpg' ) ;
365365 } ) ;
366366 } ) ;
367367 } ) ;
@@ -417,7 +417,7 @@ describe('ThumbnailComponent', () => {
417417 } ) ;
418418
419419 it ( 'should start out with isLoading$ true' , ( ) => {
420- expect ( comp . isLoading ) . toBeTrue ( ) ;
420+ expect ( comp . isLoading$ . getValue ( ) ) . toBeTrue ( ) ;
421421 expect ( de . query ( By . css ( 'ds-loading' ) ) ) . toBeTruthy ( ) ;
422422 } ) ;
423423
0 commit comments