Skip to content

Commit

Permalink
update specs..
Browse files Browse the repository at this point in the history
  • Loading branch information
carloluis committed Feb 16, 2018
1 parent d37dad8 commit e693aa2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/suggestor/__tests__/Suggestor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ describe('Suggestor component', () => {
component.setProps({ openOnClick: true });
instance.handleClick();

expect(setStateSpy).toBeCalledWith({ open: true });
expect(setStateSpy).toBeCalledWith({
filtered: expect.any(Array),
open: true
});
expect(handleCloseSpy).not.toBeCalled();
});

Expand All @@ -252,7 +255,7 @@ describe('Suggestor component', () => {
let mountedInstance, handleCloseSpy;

beforeEach(() => {
mountedInstance = mount(<Suggestor {...PROPS} />).instance();
mountedInstance = mount(<Suggestor {...PROPS} openOnClick />).instance();
handleCloseSpy = jest.spyOn(mountedInstance, 'handleClose');
});

Expand All @@ -264,14 +267,15 @@ describe('Suggestor component', () => {
mountedInstance.changeValue('temp', true);
});

it('should call when select value (2)', () => {
mountedInstance.changeValue('no match!');
});

it('should call when _onClick', () => {
mountedInstance.input = { parentNode: { contains: jest.fn() } };
mountedInstance._onClick({ target: {} });
});

it('should call when open and click', () => {
mountedInstance.handleClick();
mountedInstance.handleClick();
});
});

describe('... handles input changes', () => {
Expand Down

0 comments on commit e693aa2

Please sign in to comment.