mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 23:58:06 +01:00
f829f0069d
* Add support for snap authorship component at the top of PermissionConnect * Add PermissionCellOptions * Add details popover * Add action for revoking dynamic permissions * Improve UI and revoke logic * Better eth_accounts screen support * Fix tests * Fix lint * More linting fixes * Fix missing fence * Add another fence * Unnest permission page to fix weird CSS issues * Hide footer on permissions connect when using a snap
28 lines
949 B
JavaScript
28 lines
949 B
JavaScript
import * as React from 'react';
|
|
import { renderWithLocalization } from '../../../../../test/lib/render-helpers';
|
|
import SnapVersion from './snap-version';
|
|
|
|
describe('SnapVersion', () => {
|
|
const args = {
|
|
version: '1.4.2',
|
|
url: 'https://www.npmjs.com/package/@metamask/test-snap-error',
|
|
};
|
|
|
|
it('should render the SnapVersion without crashing and display a version', () => {
|
|
const { getByText, container } = renderWithLocalization(
|
|
<SnapVersion {...args} />,
|
|
);
|
|
expect(getByText(args.version)).toBeDefined();
|
|
expect(container.firstChild).toHaveAttribute('href', args.url);
|
|
});
|
|
|
|
it('should have a loading state if no version is passed', () => {
|
|
args.version = undefined;
|
|
|
|
const { container } = renderWithLocalization(<SnapVersion {...args} />);
|
|
|
|
expect(container.getElementsByClassName('preloader__icon')).toHaveLength(1);
|
|
expect(container.firstChild).toHaveAttribute('href', args.url);
|
|
});
|
|
});
|