@@ -32,12 +32,23 @@ describe("Editor", function() {
3232 } ) ;
3333
3434 it ( "generates the right number of sections" , function ( ) {
35- expect ( editor . sections . length ) . toBe ( 6 ) ;
36- expect ( $ ( '.inline-section' ) . length ) . toBe ( 6 ) ;
35+ expect ( editor . sections . length ) . toBe ( 8 ) ;
36+ expect ( $ ( '.inline-section' ) . length ) . toBe ( 8 ) ;
3737 expect ( editor . sections [ 0 ] ) . toBe ( '' ) ;
38- expect ( editor . editableSections . length ) . toBe ( 3 ) ;
39- expect ( $ ( '.inline-edit-form' ) . length ) . toBe ( 3 ) ;
40- expect ( $ ( '.inline-edit-form textarea' ) . length ) . toBe ( 3 ) ;
38+ expect ( editor . editableSections . length ) . toBe ( 5 ) ;
39+ expect ( $ ( '.inline-edit-form' ) . length ) . toBe ( 5 ) ;
40+ expect ( $ ( '.inline-edit-form textarea' ) . length ) . toBe ( 5 ) ;
41+ } ) ;
42+
43+ it ( "correctly splits up sections" , function ( ) {
44+ expect ( editor . sections [ 0 ] ) . toBe ( "" ) ;
45+ expect ( editor . sections [ 1 ] ) . toBe ( "### Hello, World" ) ;
46+ expect ( editor . sections [ 2 ] ) . toBe ( "This is a paragraph." ) ;
47+ expect ( editor . sections [ 3 ] ) . toBe ( "* this\n* is\n* a\n* list" ) ;
48+ expect ( editor . sections [ 4 ] ) . toBe ( "****" ) ;
49+ expect ( editor . sections [ 5 ] ) . toBe ( "### Hello again, World" ) ;
50+ expect ( editor . sections [ 6 ] ) . toBe ( "### Hello finally" ) ;
51+ expect ( editor . sections [ 7 ] ) . toBe ( "" ) ;
4152 } ) ;
4253
4354} ) ;
0 commit comments