mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
3eefe874a8
* Revert changes made to stable permission display (UI design) * Add test for new component * Update paddings for install flow * Fix missing icons on snap installation flow * Update storybook path * Add targetSubjectMetadata param --------- Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import { screen } from '@testing-library/react';
|
|
import { renderWithProvider } from '../../../../../test/jest';
|
|
import SnapPermissionsList from './snap-permissions-list';
|
|
|
|
describe('Snap Permission List', () => {
|
|
const mockPermissionData = {
|
|
snap_dialog: {
|
|
caveats: null,
|
|
date: 1680709920602,
|
|
id: '4dduR1BpsmS0ZJfeVtiAh',
|
|
invoker: 'local:http://localhost:8080',
|
|
parentCapability: 'snap_dialog',
|
|
},
|
|
};
|
|
const mockTargetSubjectMetadata = {
|
|
extensionId: null,
|
|
iconUrl: null,
|
|
name: 'TypeScript Example Snap',
|
|
origin: 'local:http://localhost:8080',
|
|
subjectType: 'snap',
|
|
version: '0.2.2',
|
|
};
|
|
|
|
it('renders permissions list for snaps', () => {
|
|
renderWithProvider(
|
|
<SnapPermissionsList
|
|
permissions={mockPermissionData}
|
|
targetSubjectMetadata={mockTargetSubjectMetadata}
|
|
/>,
|
|
);
|
|
expect(
|
|
screen.getByText('Display dialog windows in MetaMask.'),
|
|
).toBeInTheDocument();
|
|
expect(screen.getByText('Approved on 2023-04-05')).toBeInTheDocument();
|
|
});
|
|
});
|