Skip to content

Commit

Permalink
Add additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewMusgrave committed Nov 16, 2018
1 parent 9ea4285 commit 4729e2a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/TextField/tests/TextField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,23 @@ describe('<TextField />', () => {
expect(id).toBeTruthy();
});

it('updates with new id from props', () => {
it('updates with the new id from props', () => {
const id = 'input field';
const textField = mountWithAppProvider(
<TextField label="TextField" onChange={noop} />,
);
textField.setProps({id});
expect(textField.find('input').prop('id')).toBe(id);
});

it('updates with the previous id after the id prop has been removed', () => {
const id = 'input field';
const textField = mountWithAppProvider(
<TextField label="TextField" id={id} onChange={noop} />,
);
textField.setProps({});
expect(textField.find('input').prop('id')).toBe(id);
});
});

describe('autoComplete', () => {
Expand Down

0 comments on commit 4729e2a

Please sign in to comment.