mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 02:10:12 +01:00
0a376fe3ab
* MMI adds the note-to-trader component * MMI adds colors vars * MMI added component folder * MMI adds fireEvent * adds Box * review fixes * adds story * lint fix * prettier fix * prettier fix --------- Co-authored-by: Albert Olivé <albertolivecorbella@gmail.com>
24 lines
733 B
JavaScript
24 lines
733 B
JavaScript
import { render, fireEvent } from '@testing-library/react';
|
|
import React from 'react';
|
|
import sinon from 'sinon';
|
|
import NoteToTrader from './note-to-trader';
|
|
|
|
describe('NoteToTrader', () => {
|
|
it('should render the Note to trader component', () => {
|
|
const props = {
|
|
placeholder: '',
|
|
maxLength: '280',
|
|
noteText: 'some text',
|
|
labelText: 'Transaction note',
|
|
onChange: sinon.spy(),
|
|
};
|
|
|
|
const { getByTestId, container } = render(<NoteToTrader {...props} />);
|
|
|
|
fireEvent.change(getByTestId('transaction-note'));
|
|
expect(getByTestId('transaction-note').value).toBe('some text');
|
|
expect(getByTestId('transaction-note')).toBeDefined();
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
});
|