mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 20:39:08 +01:00
de955f3faa
* snaps-monorepo@0.24.0 * Fix imports and regen LavaMoat policies * Bump iframe-execution-environment * Fix tests * Add permissions * Bump patch * Bump test-snaps * [FLASK] Fix update e2e test to catch snaps with caveats (#16546) * changed snap to update to bip32 * small changes to test * Fix lint * Fix E2E * Update copy * Update icon Co-authored-by: Bowen Sanders <bowensanders@gmail.com>
32 lines
955 B
JavaScript
32 lines
955 B
JavaScript
import { endowmentPermissionBuilders } from '@metamask/snaps-controllers';
|
|
import { restrictedMethodPermissionBuilders } from '@metamask/rpc-methods';
|
|
import {
|
|
EndowmentPermissions,
|
|
ExcludedSnapEndowments,
|
|
ExcludedSnapPermissions,
|
|
RestrictedMethods,
|
|
} from './permissions';
|
|
|
|
describe('EndowmentPermissions', () => {
|
|
it('has the expected permission keys', () => {
|
|
expect(Object.keys(EndowmentPermissions).sort()).toStrictEqual(
|
|
Object.keys(endowmentPermissionBuilders)
|
|
.filter((targetKey) => !ExcludedSnapEndowments.has(targetKey))
|
|
.sort(),
|
|
);
|
|
});
|
|
});
|
|
|
|
describe('RestrictedMethods', () => {
|
|
it('has the expected permission keys', () => {
|
|
expect(Object.keys(RestrictedMethods).sort()).toStrictEqual(
|
|
[
|
|
'eth_accounts',
|
|
...Object.keys(restrictedMethodPermissionBuilders).filter(
|
|
(targetKey) => !ExcludedSnapPermissions.has(targetKey),
|
|
),
|
|
].sort(),
|
|
);
|
|
});
|
|
});
|