mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
chore(core): better doc action error message (#10288)
This commit is contained in:
@@ -856,7 +856,7 @@ test('default page role should be able to override the workspace role', async t
|
||||
await t.throwsAsync(
|
||||
updateDocDefaultRole(app, workspace.id, docId, DocRole.Manager),
|
||||
{
|
||||
message: `You do not have permission to access doc ${docId} under Space ${workspace.id}.`,
|
||||
message: `You do not have permission to perform Doc.Users.Manage action on doc ${docId}.`,
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -908,7 +908,7 @@ test('should be able to grant and revoke doc user role', async t => {
|
||||
// external user can't manage the page
|
||||
app.switchUser(external);
|
||||
await t.throwsAsync(revokeDocUserRoles(app, ws.id, docId, read.id), {
|
||||
message: `You do not have permission to access doc ${docId} under Space ${ws.id}.`,
|
||||
message: `You do not have permission to perform Doc.Users.Manage action on doc ${docId}.`,
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -922,7 +922,7 @@ test('update page default role should throw error if the space does not exist',
|
||||
await t.throwsAsync(
|
||||
updateDocDefaultRole(app, nonExistWorkspaceId, docId, DocRole.Manager),
|
||||
{
|
||||
message: `You do not have permission to access doc ${docId} under Space ${nonExistWorkspaceId}.`,
|
||||
message: `You do not have permission to perform Doc.Users.Manage action on doc ${docId}.`,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
@@ -108,12 +108,12 @@ test('should not be able to public not permitted doc', async t => {
|
||||
|
||||
await t.throwsAsync(publishDoc(app, 'not_exists_ws', 'doc2'), {
|
||||
message:
|
||||
'You do not have permission to access doc doc2 under Space not_exists_ws.',
|
||||
'You do not have permission to perform Doc.Publish action on doc doc2.',
|
||||
});
|
||||
|
||||
await t.throwsAsync(revokePublicDoc(app, 'not_exists_ws', 'doc2'), {
|
||||
message:
|
||||
'You do not have permission to access doc doc2 under Space not_exists_ws.',
|
||||
'You do not have permission to perform Doc.Publish action on doc doc2.',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user