File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ export default <CustomApplication extends Application>(feathers: CustomApplicati
84
84
isLoading . value = true ;
85
85
if ( ! _id . value ) {
86
86
data . value = undefined ;
87
+ isLoading . value = false ;
87
88
return ;
88
89
}
89
90
// TODO: the typecast below is necessary due to the prerelease state of feathers v5. The problem there is
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ describe('Get composition', () => {
179
179
} ) ;
180
180
181
181
it ( 'should un-load data after id changes to undefined' , async ( ) => {
182
- expect . assertions ( 4 ) ;
182
+ expect . assertions ( 5 ) ;
183
183
184
184
// given
185
185
const testModelId = ref < TestModel [ '_id' ] | undefined > ( testModel . _id ) ;
@@ -215,10 +215,11 @@ describe('Get composition', () => {
215
215
// then
216
216
expect ( serviceGet ) . toHaveBeenCalledTimes ( 1 ) ;
217
217
expect ( getComposition ) . toBeTruthy ( ) ;
218
+ expect ( getComposition && getComposition . isLoading . value ) . toBeFalsy ( ) ;
218
219
expect ( getComposition && getComposition . data . value ) . toBeUndefined ( ) ;
219
220
} ) ;
220
221
221
- it ( 'should indicate loading when id is undefined and load data after changing to a valid id' , async ( ) => {
222
+ it ( 'should return undefined when id is undefined and load data after changing to a valid id' , async ( ) => {
222
223
expect . assertions ( 5 ) ;
223
224
224
225
// given
@@ -246,7 +247,7 @@ describe('Get composition', () => {
246
247
247
248
// before then to ensure that the previous loading procedure is completed
248
249
await nextTick ( ) ;
249
- expect ( getComposition && getComposition . isLoading ) . toBeTruthy ( ) ;
250
+ expect ( getComposition && getComposition . isLoading . value ) . toBeFalsy ( ) ;
250
251
expect ( getComposition && getComposition . data . value ) . toBeUndefined ( ) ;
251
252
252
253
// when
You can’t perform that action at this time.
0 commit comments