@@ -4,8 +4,19 @@ import {TextBuffer} from 'atom';
4
4
5
5
import RemoteConfigurationView from '../../lib/views/remote-configuration-view' ;
6
6
import TabGroup from '../../lib/tab-group' ;
7
+ import { TabbableTextEditor } from '../../lib/views/tabbable' ;
7
8
8
9
describe ( 'RemoteConfigurationView' , function ( ) {
10
+ let atomEnv ;
11
+
12
+ beforeEach ( function ( ) {
13
+ atomEnv = global . buildAtomEnvironment ( ) ;
14
+ } ) ;
15
+
16
+ afterEach ( function ( ) {
17
+ atomEnv . destroy ( ) ;
18
+ } ) ;
19
+
9
20
function buildApp ( override = { } ) {
10
21
const sourceRemoteBuffer = new TextBuffer ( ) ;
11
22
return (
@@ -14,6 +25,7 @@ describe('RemoteConfigurationView', function() {
14
25
didChangeProtocol = { ( ) => { } }
15
26
sourceRemoteBuffer = { sourceRemoteBuffer }
16
27
tabGroup = { new TabGroup ( ) }
28
+ commands = { atomEnv . commands }
17
29
{ ...override }
18
30
/>
19
31
) ;
@@ -24,16 +36,16 @@ describe('RemoteConfigurationView', function() {
24
36
const currentProtocol = 'ssh' ;
25
37
26
38
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' ) ) ;
30
42
} ) ;
31
43
32
44
it ( 'calls a callback when the protocol is changed' , function ( ) {
33
45
const didChangeProtocol = sinon . spy ( ) ;
34
46
35
47
const wrapper = shallow ( buildApp ( { didChangeProtocol} ) ) ;
36
- wrapper . find ( '.github-RemoteConfiguration-protocolOption--ssh input .input-radio' )
48
+ wrapper . find ( '.github-RemoteConfiguration-protocolOption--ssh .input-radio' )
37
49
. prop ( 'onChange' ) ( { target : { value : 'ssh' } } ) ;
38
50
39
51
assert . isTrue ( didChangeProtocol . calledWith ( 'ssh' ) ) ;
0 commit comments