Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit c46f68a

Browse files
committed
RemoteConfigurationView tests
1 parent 0f20ab3 commit c46f68a

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

test/views/remote-configuration-view.test.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,19 @@ import {TextBuffer} from 'atom';
44

55
import RemoteConfigurationView from '../../lib/views/remote-configuration-view';
66
import TabGroup from '../../lib/tab-group';
7+
import {TabbableTextEditor} from '../../lib/views/tabbable';
78

89
describe('RemoteConfigurationView', function() {
10+
let atomEnv;
11+
12+
beforeEach(function() {
13+
atomEnv = global.buildAtomEnvironment();
14+
});
15+
16+
afterEach(function() {
17+
atomEnv.destroy();
18+
});
19+
920
function buildApp(override = {}) {
1021
const sourceRemoteBuffer = new TextBuffer();
1122
return (
@@ -14,6 +25,7 @@ describe('RemoteConfigurationView', function() {
1425
didChangeProtocol={() => {}}
1526
sourceRemoteBuffer={sourceRemoteBuffer}
1627
tabGroup={new TabGroup()}
28+
commands={atomEnv.commands}
1729
{...override}
1830
/>
1931
);
@@ -24,16 +36,16 @@ describe('RemoteConfigurationView', function() {
2436
const currentProtocol = 'ssh';
2537

2638
const wrapper = shallow(buildApp({currentProtocol, sourceRemoteBuffer}));
27-
assert.strictEqual(wrapper.find('AtomTextEditor').prop('buffer'), sourceRemoteBuffer);
28-
assert.isFalse(wrapper.find('.github-RemoteConfiguration-protocolOption--https input.input-radio').prop('checked'));
29-
assert.isTrue(wrapper.find('.github-RemoteConfiguration-protocolOption--ssh input.input-radio').prop('checked'));
39+
assert.strictEqual(wrapper.find(TabbableTextEditor).prop('buffer'), sourceRemoteBuffer);
40+
assert.isFalse(wrapper.find('.github-RemoteConfiguration-protocolOption--https .input-radio').prop('checked'));
41+
assert.isTrue(wrapper.find('.github-RemoteConfiguration-protocolOption--ssh .input-radio').prop('checked'));
3042
});
3143

3244
it('calls a callback when the protocol is changed', function() {
3345
const didChangeProtocol = sinon.spy();
3446

3547
const wrapper = shallow(buildApp({didChangeProtocol}));
36-
wrapper.find('.github-RemoteConfiguration-protocolOption--ssh input.input-radio')
48+
wrapper.find('.github-RemoteConfiguration-protocolOption--ssh .input-radio')
3749
.prop('onChange')({target: {value: 'ssh'}});
3850

3951
assert.isTrue(didChangeProtocol.calledWith('ssh'));

0 commit comments

Comments
 (0)