Skip to content

Commit

Permalink
Merge pull request #19966 from code-dot-org/school-autocomplete-fix-r…
Browse files Browse the repository at this point in the history
…emount-blank

Fix bug where unmounting and remounting the school autocomplete would…
  • Loading branch information
aoby committed Jan 12, 2018
2 parents 815e572 + dc84f14 commit 774db2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/src/templates/SchoolAutocompleteDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default class SchoolAutocompleteDropdown extends Component {
name={this.props.fieldName}
async={true}
loadOptions={this.getOptions}
cache={false}
filterOption={() => true}
value={this.props.value}
onChange={this.props.onChange}
Expand Down
4 changes: 4 additions & 0 deletions apps/test/unit/templates/SchoolAutocompleteDropdownTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ describe('SchoolAutocompleteDropdown', () => {
expect(select).to.have.prop('value', '12345');
});

it('Disables cache on the select control', () => {
expect(select).to.have.prop('cache', false);
});

it("Calls props.onChange when the selection changes", () => {
select.simulate("change", {value: '1', label: 'selected school'});
expect(handleChange).to.be.calledOnce;
Expand Down

0 comments on commit 774db2b

Please sign in to comment.