File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,36 @@ describe('EpicEditor.getElement', function () {
199
199
} ) ;
200
200
201
201
202
+ describe ( 'EpicEditor.getFiles' , function ( ) {
203
+ var testEl , editor , fooFile , barFile ;
204
+
205
+ before ( function ( ) {
206
+ localStorage . clear ( ) ;
207
+ testEl = _createTestElement ( ) ;
208
+ editor = new EpicEditor ( { basePath : '/epiceditor/' , container : testEl } ) . load ( ) ;
209
+ fooFile = 'foo' + _randomNum ( ) ;
210
+ barFile = 'bar' + _randomNum ( ) ;
211
+ editor . importFile ( fooFile , 'foo' ) ;
212
+ editor . importFile ( barFile , 'bar' ) ;
213
+ } ) ;
214
+
215
+ after ( function ( ) {
216
+ editor . unload ( ) ;
217
+ } ) ;
218
+
219
+ it ( 'check to see if the correct number of files is returned when asking for all files' , function ( ) {
220
+ var fileCount = 0 ;
221
+ for ( x in editor . getFiles ( ) ) {
222
+ fileCount ++ ;
223
+ }
224
+ expect ( fileCount ) . to ( be , 3 ) ;
225
+ } ) ;
226
+
227
+ it ( 'check to see if a single (and correct) file is returned when the name param is specified' , function ( ) {
228
+ expect ( editor . getFiles ( fooFile ) . content ) . to ( be , 'foo' ) ;
229
+ } ) ;
230
+ } ) ;
231
+
202
232
203
233
describe ( 'EpicEditor.open' , function ( ) {
204
234
You can’t perform that action at this time.
0 commit comments