File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ module.exports = function(config) {
16
16
17
17
// list of files / patterns to load in the browser
18
18
files : [
19
+ './node_modules/phantomjs-polyfill-object-assign/object-assign-polyfill.js' , //HOPE one day ditch PhantomJS polyfill
19
20
'test/*.tsx'
20
21
] ,
21
22
Original file line number Diff line number Diff line change 49
49
"karma-webpack" : " ^1.7.0" ,
50
50
"mocha" : " ^3.0.1" ,
51
51
"node-sass" : " ^3.8.0" ,
52
+ "phantomjs-polyfill-object-assign" : " 0.0.2" ,
52
53
"react" : " ^15.1.0" ,
53
54
"react-addons-test-utils" : " ^15.3.0" ,
54
55
"react-dom" : " ^15.1.0" ,
Original file line number Diff line number Diff line change @@ -129,6 +129,24 @@ describe('<Console />', function() {
129
129
expect ( wrapper . find ( '.react-console-nofocus' ) ) . length ( 0 ) ;
130
130
} ) ;
131
131
} ) ;
132
+ describe ( '[Property] handler: ' , function ( ) {
133
+ it ( 'Recieves input value' , function ( done ) {
134
+ function handler ( command : string ) {
135
+ expect ( command ) . equals ( 'ababa' ) ;
136
+ done ( ) ;
137
+ }
138
+ var wrapper = enzyme . mount ( < Console handler = { handler } /> ) ;
139
+ var typer = wrapper . find ( '.react-console-typer' ) ;
140
+ ( typer . get ( 0 ) as HTMLTextAreaElement ) . value = 'ababa' ;
141
+ typer . simulate ( 'change' ) ;
142
+ typer . simulate ( 'keyDown' , { keyCode : 13 /* Return */ } ) ;
143
+ /*
144
+ wrapper.setState({promptText: 'ababa'});
145
+ var instance = wrapper.instance() as Console;
146
+ instance.acceptLine();
147
+ */
148
+ } ) ;
149
+ } ) ;
132
150
describe ( '[Property] promptLabel: ' , function ( ) {
133
151
it ( 'Has label \'> \' when promptLabel undefined' , function ( ) {
134
152
var wrapper = enzyme . mount ( < Console /> ) ;
You can’t perform that action at this time.
0 commit comments