@@ -37,11 +37,9 @@ describe.each([
3737 await expect ( client . listIndexes ( ) ) . resolves . toHaveLength ( 0 )
3838 } )
3939 test ( `${ permission } key: create with no primary key` , async ( ) => {
40- await client
41- . createIndex ( uidNoPrimaryKey . uid )
42- . then ( ( response : Types . Index ) => {
43- expect ( response ) . toHaveProperty ( 'uid' , uidNoPrimaryKey . uid )
44- } )
40+ await client . createIndex ( uidNoPrimaryKey . uid ) . then ( ( response ) => {
41+ expect ( response ) . toHaveProperty ( 'uid' , uidNoPrimaryKey . uid )
42+ } )
4543
4644 await client
4745 . getIndex ( uidNoPrimaryKey . uid )
@@ -55,8 +53,10 @@ describe.each([
5553 } )
5654 test ( `${ permission } key: create with primary key` , async ( ) => {
5755 await client
58- . createIndex ( uidAndPrimaryKey . uid , { primaryKey : uidAndPrimaryKey . primaryKey } )
59- . then ( ( response : Types . Index ) => {
56+ . createIndex ( uidAndPrimaryKey . uid , {
57+ primaryKey : uidAndPrimaryKey . primaryKey ,
58+ } )
59+ . then ( ( response ) => {
6060 expect ( response ) . toHaveProperty ( 'uid' , uidAndPrimaryKey . uid )
6161 } )
6262 await client
@@ -138,9 +138,11 @@ describe.each([
138138 } )
139139
140140 test ( `${ permission } key: create index with already existing uid should fail` , async ( ) => {
141- await expect ( client . createIndex ( uidAndPrimaryKey . uid , { primaryKey : uidAndPrimaryKey . primaryKey } ) ) . rejects . toThrowError (
142- `index already exists`
143- )
141+ await expect (
142+ client . createIndex ( uidAndPrimaryKey . uid , {
143+ primaryKey : uidAndPrimaryKey . primaryKey ,
144+ } )
145+ ) . rejects . toThrowError ( `index already exists` )
144146 } )
145147
146148 test ( `${ permission } key: create index with missing uid should fail` , async ( ) => {
@@ -224,14 +226,16 @@ describe.each([{ client: publicClient, permission: 'Public' }])(
224226 )
225227 } )
226228 test ( `${ permission } key: try to create Index with primary key and be denied` , async ( ) => {
227- await expect ( client . createIndex ( uidAndPrimaryKey . uid , { primaryKey : uidAndPrimaryKey . primaryKey } ) ) . rejects . toThrowError (
228- `Invalid API key: ${ PUBLIC_KEY } `
229- )
229+ await expect (
230+ client . createIndex ( uidAndPrimaryKey . uid , {
231+ primaryKey : uidAndPrimaryKey . primaryKey ,
232+ } )
233+ ) . rejects . toThrowError ( `Invalid API key: ${ PUBLIC_KEY } ` )
230234 } )
231235 test ( `${ permission } key: try to create Index with NO primary key and be denied` , async ( ) => {
232- await expect ( client . createIndex ( uidNoPrimaryKey . uid ) ) . rejects . toThrowError (
233- `Invalid API key: ${ PUBLIC_KEY } `
234- )
236+ await expect (
237+ client . createIndex ( uidNoPrimaryKey . uid )
238+ ) . rejects . toThrowError ( `Invalid API key: ${ PUBLIC_KEY } ` )
235239 } )
236240 test ( `${ permission } key: try to get index info and be denied` , async ( ) => {
237241 await expect (
@@ -245,7 +249,9 @@ describe.each([{ client: publicClient, permission: 'Public' }])(
245249 } )
246250 test ( `${ permission } key: try to update index and be denied` , async ( ) => {
247251 await expect (
248- client . getIndex ( uidAndPrimaryKey . uid ) . updateIndex ( { primaryKey : uidAndPrimaryKey . primaryKey } )
252+ client
253+ . getIndex ( uidAndPrimaryKey . uid )
254+ . updateIndex ( { primaryKey : uidAndPrimaryKey . primaryKey } )
249255 ) . rejects . toThrowError ( `Invalid API key: ${ PUBLIC_KEY } ` )
250256 } )
251257 } )
@@ -284,14 +290,16 @@ describe.each([{ client: anonymousClient, permission: 'No' }])(
284290 )
285291 } )
286292 test ( `${ permission } key: try to create an index with primary key and be denied` , async ( ) => {
287- await expect ( client . createIndex ( uidAndPrimaryKey . uid , { primaryKey : uidAndPrimaryKey . primaryKey } ) ) . rejects . toThrowError (
288- `You must have an authorization token`
289- )
293+ await expect (
294+ client . createIndex ( uidAndPrimaryKey . uid , {
295+ primaryKey : uidAndPrimaryKey . primaryKey ,
296+ } )
297+ ) . rejects . toThrowError ( `You must have an authorization token` )
290298 } )
291299 test ( `${ permission } key: try to create an index with NO primary key and be denied` , async ( ) => {
292- await expect ( client . createIndex ( uidNoPrimaryKey . uid ) ) . rejects . toThrowError (
293- `You must have an authorization token`
294- )
300+ await expect (
301+ client . createIndex ( uidNoPrimaryKey . uid )
302+ ) . rejects . toThrowError ( `You must have an authorization token` )
295303 } )
296304 test ( `${ permission } key: try to get index info and be denied` , async ( ) => {
297305 await expect (
@@ -305,7 +313,9 @@ describe.each([{ client: anonymousClient, permission: 'No' }])(
305313 } )
306314 test ( `${ permission } key: try to update index and be denied` , async ( ) => {
307315 await expect (
308- client . getIndex ( uidAndPrimaryKey . uid ) . updateIndex ( { primaryKey : uidAndPrimaryKey . primaryKey } )
316+ client
317+ . getIndex ( uidAndPrimaryKey . uid )
318+ . updateIndex ( { primaryKey : uidAndPrimaryKey . primaryKey } )
309319 ) . rejects . toThrowError ( `You must have an authorization token` )
310320 } )
311321 } )
0 commit comments