Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scniro committed Oct 27, 2017
1 parent 2169158 commit 3a149ab
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ var Shared = (function () {
});
}
break;
default: {
break;
}
}
};
return Shared;
Expand Down
3 changes: 0 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ class Shared implements ICommon {
});
}
break;
default: {
break;
}
}
}
}
Expand Down
37 changes: 35 additions & 2 deletions test/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import {Controlled, UnControlled} from '../src';
Enzyme.configure({adapter: new Adapter()});

global.console = {
warn: jest.fn()
}
warn: jest.fn(),
log: console.log
};

describe('[temporary] deprecation notice', () => {

Expand Down Expand Up @@ -327,4 +328,36 @@ describe('Props', () => {
}}/>
);
});

it('[Controlled]: autoFocus', () => {
let wrapper = Enzyme.mount(
<Controlled
value='foo'
autoFocus={true}
cursor={{
line: 0,
ch: 3
}}/>
);

let editor = wrapper.instance().editor;

expect(editor.state.focused).toBe(true)
});

it('[UnControlled]: autoFocus', () => {
let wrapper = Enzyme.mount(
<UnControlled
value='foo'
autoFocus={true}
cursor={{
line: 0,
ch: 3
}}/>
);

let editor = wrapper.instance().editor;

expect(editor.state.focused).toBe(true)
});
});

0 comments on commit 3a149ab

Please sign in to comment.