fix(editor): Handle permission edge cases (empty scopes) (#7723)

This commit is contained in:
Csaba Tuncsik
2023-11-16 18:08:23 +01:00
committed by GitHub
parent 9d6a68d1c7
commit e2ffd397fc
4 changed files with 38 additions and 33 deletions

View File

@@ -80,6 +80,12 @@ describe('hasScope', () => {
global: memberPermissions,
}),
).toBe(false);
expect(
hasScope([], {
global: memberPermissions,
}),
).toBe(false);
});
test('should work with allOf mode', () => {
@@ -112,5 +118,15 @@ describe('hasScope', () => {
{ mode: 'allOf' },
),
).toBe(false);
expect(
hasScope(
[],
{
global: memberPermissions,
},
{ mode: 'allOf' },
),
).toBe(false);
});
});