@@ -106,6 +106,65 @@ describe('use/find', function() {
106
106
assert ( qid . value === 'default' )
107
107
} )
108
108
109
+ it ( 'returns correct default data even when params is not reactive' , function ( ) {
110
+ const { Instrument } = makeContext ( )
111
+
112
+ const instrumentsData = useFind ( {
113
+ model : Instrument ,
114
+ params : {
115
+ query : { } ,
116
+ paginate : false
117
+ }
118
+ } )
119
+
120
+ const {
121
+ debounceTime,
122
+ error,
123
+ haveBeenRequested,
124
+ haveLoaded,
125
+ isPending,
126
+ isLocal,
127
+ items,
128
+ latestQuery,
129
+ paginationData,
130
+ qid
131
+ } = instrumentsData
132
+
133
+ assert ( isRef ( debounceTime ) )
134
+ assert ( debounceTime . value === null )
135
+
136
+ assert ( isRef ( error ) )
137
+ assert ( error . value === null )
138
+
139
+ assert ( isRef ( haveBeenRequested ) )
140
+ assert ( haveBeenRequested . value === true )
141
+
142
+ assert ( isRef ( haveLoaded ) )
143
+ assert ( haveLoaded . value === false )
144
+
145
+ assert ( isRef ( isPending ) )
146
+ assert ( isPending . value === true )
147
+
148
+ assert ( isRef ( isLocal ) )
149
+ assert ( isLocal . value === false )
150
+
151
+ assert ( isRef ( items ) )
152
+ assert ( Array . isArray ( items . value ) )
153
+ assert ( items . value . length === 0 )
154
+
155
+ assert ( isRef ( latestQuery ) )
156
+ assert ( latestQuery . value === null )
157
+
158
+ assert ( isRef ( paginationData ) )
159
+ assert . deepStrictEqual ( paginationData . value , {
160
+ defaultLimit : null ,
161
+ defaultSkip : null
162
+ } )
163
+
164
+ assert ( isRef ( qid ) )
165
+ assert ( qid . value === 'default' )
166
+ } )
167
+
109
168
it ( 'allows passing {lazy:true} to not query immediately' , function ( ) {
110
169
const { Instrument } = makeContext ( )
111
170
0 commit comments