@@ -2,7 +2,6 @@ import * as React from 'react';
2
2
import 'jest' ;
3
3
import { shallow } from 'enzyme' ;
4
4
import { CommitBox } from '../../src/components/CommitBox' ;
5
- import { commitButtonDisabledClass } from '../../src/style/CommitBox' ;
6
5
7
6
describe ( 'CommitBox' , ( ) => {
8
7
describe ( '#constructor()' , ( ) => {
@@ -99,8 +98,8 @@ describe('CommitBox', () => {
99
98
} ;
100
99
const component = shallow ( < CommitBox { ...props } /> ) ;
101
100
const node = component . find ( 'input[type="button"]' ) . first ( ) ;
102
- const idx = node . prop ( 'className' ) . indexOf ( commitButtonDisabledClass ) ;
103
- expect ( idx >= 0 ) . toEqual ( true ) ;
101
+ const prop = node . prop ( 'disabled' ) ;
102
+ expect ( prop ) . toEqual ( true ) ;
104
103
} ) ;
105
104
106
105
it ( 'should apply a class to disable the commit button when files have changes to commit, but the user has not entered a commit message summary' , ( ) => {
@@ -110,8 +109,8 @@ describe('CommitBox', () => {
110
109
} ;
111
110
const component = shallow ( < CommitBox { ...props } /> ) ;
112
111
const node = component . find ( 'input[type="button"]' ) . first ( ) ;
113
- const idx = node . prop ( 'className' ) . indexOf ( commitButtonDisabledClass ) ;
114
- expect ( idx >= 0 ) . toEqual ( true ) ;
112
+ const prop = node . prop ( 'disabled' ) ;
113
+ expect ( prop ) . toEqual ( true ) ;
115
114
} ) ;
116
115
117
116
it ( 'should not apply a class to disable the commit button when files have changes to commit and the user has entered a commit message summary' , ( ) => {
@@ -125,8 +124,8 @@ describe('CommitBox', () => {
125
124
} ) ;
126
125
127
126
const node = component . find ( 'input[type="button"]' ) . first ( ) ;
128
- const idx = node . prop ( 'className' ) . indexOf ( commitButtonDisabledClass ) ;
129
- expect ( idx >= 0 ) . toEqual ( false ) ;
127
+ const prop = node . prop ( 'disabled' ) ;
128
+ expect ( prop ) . toEqual ( false ) ;
130
129
} ) ;
131
130
} ) ;
132
131
} ) ;
0 commit comments