test(create-step): state permission conditions explicitly
This commit is contained in:
@@ -20,12 +20,14 @@ describe('POST /api/v1/flows/:flowId/steps', () => {
|
|||||||
roleId: currentUser.roleId,
|
roleId: currentUser.roleId,
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
action: 'read',
|
action: 'read',
|
||||||
|
conditions: ['isCreator'],
|
||||||
});
|
});
|
||||||
|
|
||||||
await createPermission({
|
await createPermission({
|
||||||
roleId: currentUser.roleId,
|
roleId: currentUser.roleId,
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
action: 'update',
|
action: 'update',
|
||||||
|
conditions: ['isCreator'],
|
||||||
});
|
});
|
||||||
|
|
||||||
flow = await createFlow({ userId: currentUser.id });
|
flow = await createFlow({ userId: currentUser.id });
|
||||||
@@ -36,7 +38,7 @@ describe('POST /api/v1/flows/:flowId/steps', () => {
|
|||||||
token = await createAuthTokenByUserId(currentUser.id);
|
token = await createAuthTokenByUserId(currentUser.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return created step', async () => {
|
it('should return created step for current user', async () => {
|
||||||
const response = await request(app)
|
const response = await request(app)
|
||||||
.post(`/api/v1/flows/${flow.id}/steps`)
|
.post(`/api/v1/flows/${flow.id}/steps`)
|
||||||
.set('Authorization', token)
|
.set('Authorization', token)
|
||||||
|
Reference in New Issue
Block a user