1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00
metamask-extension/ui/components/institutional/jwt-dropdown/jwt-dropdown.test.js
António Regadas 0b83b13b4a
MMI adds the Jwt dropdown component (#18117)
* MMI adds the Jwt dropdown

* MMI prettier

* review fixes

* MMI added stories file
2023-03-16 11:03:54 +00:00

24 lines
643 B
JavaScript

import { render, fireEvent } from '@testing-library/react';
import React from 'react';
import sinon from 'sinon';
import JwtDropdown from './jwt-dropdown';
describe('JwtDropdown', () => {
it('should render the Jwt dropdown component', () => {
const props = {
jwtList: ['jwy1', 'jwt2'],
currentJwt: 'someToken',
onChange: sinon.spy(),
};
const { getByTestId, container } = render(<JwtDropdown {...props} />);
fireEvent.change(getByTestId('jwt-dropdown'), {
target: { value: 'jwt2' },
});
expect(getByTestId('jwt-dropdown')).toBeDefined();
expect(container).toMatchSnapshot();
});
});