@@ -10,6 +10,8 @@ describe('useQuerySettings', () => {
1010 pageIndex : 0 ,
1111 sortBy : null ,
1212 order : null ,
13+ scopes : null ,
14+ organizations : null ,
1315 } ;
1416
1517 it ( 'should initialize with default query settings when no initial settings provided' , ( ) => {
@@ -27,6 +29,8 @@ describe('useQuerySettings', () => {
2729 pageIndex : 2 ,
2830 sortBy : 'username' ,
2931 order : 'asc' ,
32+ scopes : null ,
33+ organizations : null ,
3034 } ;
3135
3236 const { result } = renderHook ( ( ) => useQuerySettings ( customInitialSettings ) ) ;
@@ -42,8 +46,8 @@ describe('useQuerySettings', () => {
4246 pageIndex : 1 ,
4347 sortBy : [ { id : 'username' , desc : false } ] ,
4448 filters : [
45- { id : 'roles ' , value : [ 'admin' , 'editor' ] } ,
46- { id : 'username ' , value : 'john' } ,
49+ { id : 'role ' , value : [ 'admin' , 'editor' ] } ,
50+ { id : 'name ' , value : 'john' } ,
4751 ] ,
4852 } ;
4953
@@ -58,6 +62,8 @@ describe('useQuerySettings', () => {
5862 pageIndex : 1 ,
5963 sortBy : 'username' ,
6064 order : 'asc' ,
65+ scopes : null ,
66+ organizations : null ,
6167 } ) ;
6268 } ) ;
6369
@@ -133,6 +139,8 @@ describe('useQuerySettings', () => {
133139 pageIndex : 0 ,
134140 order : null ,
135141 sortBy : null ,
142+ organizations : null ,
143+ scopes : null ,
136144 } ) ;
137145 } ) ;
138146
@@ -160,6 +168,8 @@ describe('useQuerySettings', () => {
160168 pageIndex : 0 ,
161169 order : null ,
162170 sortBy : null ,
171+ organizations : null ,
172+ scopes : null ,
163173 } ) ;
164174 } ) ;
165175
@@ -187,6 +197,8 @@ describe('useQuerySettings', () => {
187197 pageIndex : 0 ,
188198 order : null ,
189199 sortBy : null ,
200+ organizations : null ,
201+ scopes : null ,
190202 } ) ;
191203 } ) ;
192204
@@ -255,9 +267,11 @@ describe('useQuerySettings', () => {
255267 pageIndex : 3 ,
256268 sortBy : [ { id : 'userRole' , desc : true } ] ,
257269 filters : [
258- { id : 'roles ' , value : [ 'admin' , 'editor' , 'viewer' ] } ,
259- { id :
'username ' , value :
'[email protected] ' } , 270+ { id : 'role ' , value : [ 'admin' , 'editor' , 'viewer' ] } ,
271+ { id :
'name ' , value :
'[email protected] ' } , 260272 { id : 'otherFilter' , value : 'ignored' } , // Should be ignored
273+ { id : 'org' , value : [ 'org1' , 'org2' ] } ,
274+ { id : 'scope' , value : [ 'scope1' , 'scope2' ] } ,
261275 ] ,
262276 } ;
263277
@@ -272,6 +286,9 @@ describe('useQuerySettings', () => {
272286 pageIndex : 3 ,
273287 order : 'desc' ,
274288 sortBy : 'user_role' ,
289+ organizations : 'org1,org2' ,
290+ scopes : 'scope1,scope2' ,
291+
275292 } ) ;
276293 } ) ;
277294
@@ -310,7 +327,7 @@ describe('useQuerySettings', () => {
310327 pageIndex : 0 ,
311328 sortBy : [ ] ,
312329 filters : [
313- { id : 'username ' , value : ' ' } , // Whitespace only
330+ { id : 'name ' , value : ' ' } , // Whitespace only
314331 ] ,
315332 } ;
316333
@@ -330,7 +347,7 @@ describe('useQuerySettings', () => {
330347 pageSize : 10 ,
331348 pageIndex : 0 ,
332349 sortBy : [ ] ,
333- filters : [ { id : 'roles ' , value : [ 'admin' ] } ] ,
350+ filters : [ { id : 'role ' , value : [ 'admin' ] } ] ,
334351 } ) ;
335352 } ) ;
336353
@@ -342,7 +359,7 @@ describe('useQuerySettings', () => {
342359 pageSize : 10 ,
343360 pageIndex : 0 ,
344361 sortBy : [ ] ,
345- filters : [ { id : 'roles ' , value : [ 'editor' ] } ] ,
362+ filters : [ { id : 'role ' , value : [ 'editor' ] } ] ,
346363 } ) ;
347364 } ) ;
348365
@@ -359,7 +376,7 @@ describe('useQuerySettings', () => {
359376 pageSize : 10 ,
360377 pageIndex : 0 ,
361378 sortBy : [ ] ,
362- filters : [ { id : 'username ' , value : 'john' } ] ,
379+ filters : [ { id : 'name ' , value : 'john' } ] ,
363380 } ) ;
364381 } ) ;
365382
@@ -371,7 +388,7 @@ describe('useQuerySettings', () => {
371388 pageSize : 10 ,
372389 pageIndex : 0 ,
373390 sortBy : [ ] ,
374- filters : [ { id : 'username ' , value : 'jane' } ] ,
391+ filters : [ { id : 'name ' , value : 'jane' } ] ,
375392 } ) ;
376393 } ) ;
377394
0 commit comments