Add test utils

This commit is contained in:
Adria Navarro 2024-08-26 12:11:09 +02:00
parent 6d3006e80e
commit ec2e5a0263
1 changed files with 38 additions and 0 deletions

View File

@ -70,4 +70,42 @@ export class RowActionAPI extends TestAPI {
}
)
}
setViewPermission = async (
tableId: string,
viewId: string,
rowActionId: string,
expectations?: Expectations,
config?: { publicUser?: boolean }
) => {
return await this._post<RowActionResponse>(
`/api/tables/${tableId}/actions/${rowActionId}/permissions/${viewId}`,
{
expectations: {
...expectations,
status: expectations?.status || 204,
},
...config,
}
)
}
unsetViewPermission = async (
tableId: string,
viewId: string,
rowActionId: string,
expectations?: Expectations,
config?: { publicUser?: boolean }
) => {
return await this._delete<RowActionResponse>(
`/api/tables/${tableId}/actions/${rowActionId}/permissions/${viewId}`,
{
expectations: {
...expectations,
status: expectations?.status || 204,
},
...config,
}
)
}
}