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', () => { it('should select another option', () => {
const onChange = jest.fn(); 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'); const input = wrapper.find('input');
input.at(0).instance().value = 'two'; 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`] = ` exports[`Select should select another option 1`] = `
<Component <Component
onChange={[MockFunction]} onInputChange={
[MockFunction] {
"calls": Array [
Array [
"two",
Object {
"action": "input-change",
},
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
options={ options={
Array [ Array [
Object { Object {
@ -171,7 +188,24 @@ exports[`Select should select another option 1`] = `
} }
> >
<Select <Select
onChange={[MockFunction]} onInputChange={
[MockFunction] {
"calls": Array [
Array [
"two",
Object {
"action": "input-change",
},
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
options={ options={
Array [ Array [
Object { Object {
@ -208,7 +242,24 @@ exports[`Select should select another option 1`] = `
defaultInputValue="" defaultInputValue=""
defaultMenuIsOpen={false} defaultMenuIsOpen={false}
defaultValue={null} defaultValue={null}
onChange={[MockFunction]} onInputChange={
[MockFunction] {
"calls": Array [
Array [
"two",
Object {
"action": "input-change",
},
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
options={ options={
Array [ Array [
Object { Object {