@@ -144,7 +144,7 @@ describe.each([{ permission: "Admin" }])(
144144
145145 expect ( apiKeyUid ) . toEqual ( uid ) ;
146146 expect ( exp ) . toBeUndefined ( ) ;
147- expect ( searchRules ) . toEqual ( [ ] ) ;
147+ expect ( searchRules ) . toEqual ( [ "*" ] ) ;
148148 } ) ;
149149
150150 test ( `${ permission } key: create a tenant token with array searchRules and test payload` , async ( ) => {
@@ -192,7 +192,6 @@ describe.each([{ permission: "Admin" }])(
192192 const token = await generateTenantToken ( {
193193 apiKey,
194194 apiKeyUid : uid ,
195- searchRules : [ "*" ] ,
196195 } ) ;
197196
198197 const searchClient = new MeiliSearch ( { host : HOST , apiKey : token } ) ;
@@ -214,7 +213,6 @@ describe.each([{ permission: "Admin" }])(
214213 const token = await generateTenantToken ( {
215214 apiKey : key ,
216215 apiKeyUid : uid ,
217- searchRules : [ "*" ] ,
218216 } ) ;
219217
220218 const searchClient = new MeiliSearch ( { host : HOST , apiKey : token } ) ;
@@ -231,7 +229,6 @@ describe.each([{ permission: "Admin" }])(
231229 const token = await generateTenantToken ( {
232230 apiKey,
233231 apiKeyUid : uid ,
234- searchRules : [ "*" ] ,
235232 expiresAt : date ,
236233 } ) ;
237234
@@ -246,7 +243,7 @@ describe.each([{ permission: "Admin" }])(
246243 ) . resolves . not . toBeUndefined ( ) ;
247244 } ) ;
248245
249- test ( `${ permission } key: Search in tenant token with expireAt value set in the past` , async ( ) => {
246+ test ( `${ permission } key: Search in tenant token with expireAt value set in the past throws an error on usage ` , async ( ) => {
250247 const client = await getClient ( permission ) ;
251248 const apiKey = await getKey ( permission ) ;
252249 const { uid } = await client . getKey ( apiKey ) ;
@@ -255,7 +252,6 @@ describe.each([{ permission: "Admin" }])(
255252 const token = await generateTenantToken ( {
256253 apiKey,
257254 apiKeyUid : uid ,
258- searchRules : [ "*" ] ,
259255 expiresAt : date ,
260256 } ) ;
261257
@@ -316,6 +312,7 @@ describe.each([{ permission: "Admin" }])(
316312 const token = await generateTenantToken ( {
317313 apiKey,
318314 apiKeyUid : uid ,
315+ searchRules : [ ] ,
319316 } ) ;
320317
321318 const searchClient = new MeiliSearch ( { host : HOST , apiKey : token } ) ;
@@ -344,7 +341,7 @@ describe.each([{ permission: "Admin" }])(
344341 ) . rejects . toHaveProperty ( "cause.code" , "invalid_api_key" ) ;
345342 } ) ;
346343
347- test ( `${ permission } key: Creates tenant token with an expiration date as UNIX timestamp in the past throws an error` , async ( ) => {
344+ test ( `${ permission } key: Creates tenant token with an expiration date as UNIX timestamp in the past throws an error on usage ` , async ( ) => {
348345 const client = await getClient ( permission ) ;
349346 const apiKey = await getKey ( permission ) ;
350347 const { uid } = await client . getKey ( apiKey ) ;
0 commit comments