Skip to content

Commit

Permalink
Add ref tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gojohnnygo committed Jul 29, 2016
1 parent 38ca948 commit 15ba7d2
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion test/Select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ describe('Select', () => {
{ value: 'ten', label: 'ten' }
];

describe('with simple options', () => {
describe('has refs', () => {
beforeEach(() => {
options = [
{ value: 'one', label: 'One' },
Expand All @@ -215,9 +215,53 @@ describe('Select', () => {
value: 'one',
options: options,
simpleValue: true,
joinValues: true,
});
});

it('input', () => {
expect(instance.input, 'not to equal', undefined);
});

it('value', () => {
typeSearchText('o');
expect(instance.value, 'not to equal', undefined);
});

it('menuContainer', () => {
clickArrowToOpen();
expect(instance.menuContainer, 'not to equal', undefined);
});

it('menu', () => {
clickArrowToOpen();
expect(instance.menu, 'not to equal', undefined);
});

it('wrapper', () => {
expect(instance.wrapper, 'not to equal', undefined);
});

it('control', () => {
expect(instance.control, 'not to equal', undefined);
});
});

describe('with simple options', () => {
beforeEach(() => {
options = [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
{ value: 'three', label: 'Three' }
];

instance = createControl({
name: 'form-field-name',
value: 'one',
options: options,
simpleValue: true,
});
});

it('should assign the given name', () => {
var selectInputElement = TestUtils.scryRenderedDOMComponentsWithTag(instance, 'input')[0];
Expand Down

0 comments on commit 15ba7d2

Please sign in to comment.