This commit is contained in:
Nathan Bierema 2020-09-04 00:02:07 -04:00
parent 13eeae95d7
commit 18694e567d
2 changed files with 57 additions and 4 deletions

View File

@ -30,7 +30,9 @@ describe('Select', function () {
it('should select another option', () => {
const onChange = jest.fn();
const wrapper = mount(<Select options={options} onChange={onChange} />);
const wrapper = mount(
<Select options={options} onInputChange={onChange} />
);
const input = wrapper.find('input');
input.at(0).instance().value = 'two';

View File

@ -152,7 +152,24 @@ exports[`Select renders with props 1`] = `
exports[`Select should select another option 1`] = `
<Component
onChange={[MockFunction]}
onInputChange={
[MockFunction] {
"calls": Array [
Array [
"two",
Object {
"action": "input-change",
},
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
options={
Array [
Object {
@ -171,7 +188,24 @@ exports[`Select should select another option 1`] = `
}
>
<Select
onChange={[MockFunction]}
onInputChange={
[MockFunction] {
"calls": Array [
Array [
"two",
Object {
"action": "input-change",
},
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
options={
Array [
Object {
@ -208,7 +242,24 @@ exports[`Select should select another option 1`] = `
defaultInputValue=""
defaultMenuIsOpen={false}
defaultValue={null}
onChange={[MockFunction]}
onInputChange={
[MockFunction] {
"calls": Array [
Array [
"two",
Object {
"action": "input-change",
},
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
options={
Array [
Object {