Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add failing test for late-arriving options
This specifically tests when the options change to include
the value. This is a bug.
  • Loading branch information
bruderstein committed Jul 27, 2015
commit cb04c3000f7760b578527d2b5eec6a526866fa5c
20 changes: 20 additions & 0 deletions test/Select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,5 +349,25 @@ describe('Select', function() {
expect(React.findDOMNode(instance), 'queried for', DISPLAYED_SELECTION_SELECTOR,
'to have items satisfying', 'to have text', 'something new');
});

it('updates the display text if the option appears later', function () {

wrapper.setPropsForChild({
value: 'new'
});

wrapper.setPropsForChild({
options: [
{ value: 'one', label: 'One' },
{ value: 'two', labal: 'Two' },
{ value: 'new', label: 'New item in the options' },
{ value: 'three', label: 'Three' }
]
});

expect(React.findDOMNode(instance), 'queried for', DISPLAYED_SELECTION_SELECTOR,
'to have items satisfying', 'to have text', 'New item in the options');

});
});
});