@@ -128,14 +128,13 @@ describe('stackascii init', () => {
128128 } ) ;
129129 mockLastexpr . mockImplementation ( ( raw , blocks , op ) => `EXTRACT:${ raw } :${ blocks . map ( ( block ) => block . type ) . join ( '|' ) } ` ) ;
130130
131- const stackJS = { clear_input : jest . fn ( ) } ;
132131 const operations = [
133132 { operation : 'filter' , type : 'markdown' , reset : 'false' , display : 'true' } ,
134133 { operation : 'filter' , type : 'calculation' , reset : 'true' } ,
135134 { operation : 'extractor' , type : 'unknown' }
136135 ] ;
137136
138- init ( [ 'markdownInput' , 'answer1' , 'answer2' ] , operations , stackJS ) ;
137+ init ( [ 'markdownInput' , 'answer1' , 'answer2' ] , operations ) ;
139138
140139 expect ( mockMarkdown ) . toHaveBeenCalledWith ( 'alpha' , expect . any ( Object ) , operations [ 0 ] ) ;
141140 expect ( mockCalculation ) . toHaveBeenCalledWith ( 'alpha' , expect . any ( Object ) , operations [ 1 ] ) ;
@@ -146,7 +145,6 @@ describe('stackascii init', () => {
146145 expect ( env . output . innerHTML ) . toBe ( 'MD:alpha' ) ;
147146 expect ( env . answers [ 0 ] . value ) . toBe ( 'EXTRACT:alpha:markdown|calculation' ) ;
148147 expect ( env . answers [ 0 ] . dispatchEvent ) . toHaveBeenCalledWith ( { type : 'change' } ) ;
149- expect ( stackJS . clear_input ) . not . toHaveBeenCalled ( ) ;
150148 expect ( global . MathJax . typesetPromise ) . toHaveBeenCalledWith ( [ env . output ] ) ;
151149 } ) ;
152150
@@ -164,15 +162,14 @@ describe('stackascii init', () => {
164162 mockLastexpr . mockImplementation ( ( raw , blocks , op ) => `EXTRACT:${ raw } :${ blocks . map ( ( block ) => block . type ) . join ( '|' ) } ` ) ;
165163 mockLastcalc . mockImplementation ( ( raw , blocks , op ) => `EXTRACTCALC:${ raw } :${ blocks . map ( ( block ) => block . type ) . join ( '|' ) } ` ) ;
166164
167- const stackJS = { clear_input : jest . fn ( ) } ;
168165 const operations = [
169166 { operation : 'filter' , type : 'markdown' } ,
170167 { operation : 'extractor' , type : 'lastexpr' } ,
171168 { operation : 'filter' , type : 'calculation' } ,
172169 { operation : 'extractor' , type : 'lastcalc' }
173170 ] ;
174171
175- init ( [ 'markdownInput' , 'answer1' , 'answer2' ] , operations , stackJS ) ;
172+ init ( [ 'markdownInput' , 'answer1' , 'answer2' ] , operations ) ;
176173
177174 expect ( mockMarkdown ) . toHaveBeenCalledWith ( 'alpha' , expect . any ( Object ) , operations [ 0 ] ) ;
178175 expect ( mockLastexpr ) . toHaveBeenCalledWith ( 'alpha' , [
@@ -187,7 +184,6 @@ describe('stackascii init', () => {
187184 expect ( env . answers [ 0 ] . dispatchEvent ) . toHaveBeenCalledWith ( { type : 'change' } ) ;
188185 expect ( env . answers [ 1 ] . value ) . toBe ( 'EXTRACTCALC:alpha:calculation' ) ;
189186 expect ( env . answers [ 1 ] . dispatchEvent ) . toHaveBeenCalledWith ( { type : 'change' } ) ;
190- expect ( stackJS . clear_input ) . not . toHaveBeenCalled ( ) ;
191187 expect ( global . MathJax . typesetPromise ) . toHaveBeenCalledWith ( [ env . output ] ) ;
192188 } ) ;
193189
@@ -196,15 +192,13 @@ describe('stackascii init', () => {
196192
197193 mockFinalfunction . mockReturnValue ( 'ERROR' ) ;
198194
199- const stackJS = { clear_input : jest . fn ( ) } ;
200195 const operations = [ { operation : 'extractor' , type : 'finalfunction' } ] ;
201196
202- init ( [ 'markdownInput' , 'answer1' ] , operations , stackJS ) ;
197+ init ( [ 'markdownInput' , 'answer1' ] , operations ) ;
203198
204199 expect ( mockFinalfunction ) . toHaveBeenCalledWith ( 'beta' , [ ] , operations [ 0 ] ) ;
205- expect ( stackJS . clear_input ) . toHaveBeenCalledWith ( 'answer1' ) ;
206200 expect ( env . answers [ 0 ] . value ) . toBe ( '' ) ;
207- expect ( env . answers [ 0 ] . dispatchEvent ) . not . toHaveBeenCalled ( ) ;
201+ expect ( env . answers [ 0 ] . dispatchEvent ) . toHaveBeenCalledTimes ( 1 ) ;
208202 expect ( env . output . innerHTML ) . toBe ( 'beta' ) ;
209203 } ) ;
210204
@@ -213,10 +207,9 @@ describe('stackascii init', () => {
213207
214208 mockMarkdown . mockImplementation ( ( text ) => `MD:${ text } ` ) ;
215209
216- const stackJS = { clear_input : jest . fn ( ) } ;
217210 const operations = [ { operation : 'filter' , type : 'markdown' , reset : 'false' , display : 'false' } ] ;
218211
219- init ( [ 'markdownInput' ] , operations , stackJS ) ;
212+ init ( [ 'markdownInput' ] , operations ) ;
220213
221214 expect ( env . markdownInput . addEventListener ) . toHaveBeenCalledWith ( 'change' , expect . any ( Function ) ) ;
222215 expect ( mockMarkdown ) . toHaveBeenCalledTimes ( 1 ) ;
0 commit comments