@@ -181,7 +181,7 @@ describe('taExecCommand', function(){
181
181
} ) ) ;
182
182
} ) ;
183
183
} ) ;
184
- describe ( 'list to other' , function ( ) {
184
+ describe ( 'list to other/list ' , function ( ) {
185
185
var element ;
186
186
describe ( 'li selected' , function ( ) {
187
187
it ( 'from ol' , inject ( function ( taSelection , taExecCommand ) {
@@ -198,6 +198,34 @@ describe('taExecCommand', function(){
198
198
} ) ) ;
199
199
} ) ;
200
200
describe ( 'list selected' , function ( ) {
201
+ describe ( 'edge mixed case' , function ( ) {
202
+ it ( 'to ol' , inject ( function ( taSelection , taExecCommand ) {
203
+ element = angular . element ( '<div class="ta-bind"><ol><li>To the List!</li></ol><span><ul><li>To the List!</li></ul></span></div>' ) ;
204
+ taSelection . element = element [ 0 ] ;
205
+ taExecCommand ( ) ( 'insertorderedlist' , false , null ) ;
206
+ expect ( element . html ( ) ) . toBe ( '<ol><li>To the List!</li><li>To the List!</li></ol>' ) ;
207
+ } ) ) ;
208
+ it ( 'to ul' , inject ( function ( taSelection , taExecCommand ) {
209
+ element = angular . element ( '<div class="ta-bind"><ol><li>To the List!</li></ol><span><ul><li>To the List!</li></ul></span></div>' ) ;
210
+ taSelection . element = element [ 0 ] ;
211
+ taExecCommand ( ) ( 'insertunorderedlist' , false , null ) ;
212
+ expect ( element . html ( ) ) . toBe ( '<ul><li>To the List!</li><li>To the List!</li></ul>' ) ;
213
+ } ) ) ;
214
+ } ) ;
215
+ describe ( 'mixed as child of ta-bind' , function ( ) {
216
+ it ( 'to ol' , inject ( function ( taSelection , taExecCommand ) {
217
+ element = angular . element ( '<div class="ta-bind"><ol><li>To the List!</li></ol><ul><li>To the List!</li></ul></div>' ) ;
218
+ taSelection . element = element [ 0 ] ;
219
+ taExecCommand ( ) ( 'insertorderedlist' , false , null ) ;
220
+ expect ( element . html ( ) ) . toBe ( '<ol><li>To the List!</li><li>To the List!</li></ol>' ) ;
221
+ } ) ) ;
222
+ it ( 'to ul' , inject ( function ( taSelection , taExecCommand ) {
223
+ element = angular . element ( '<div class="ta-bind"><ol><li>To the List!</li></ol><ul><li>To the List!</li></ul></div>' ) ;
224
+ taSelection . element = element [ 0 ] ;
225
+ taExecCommand ( ) ( 'insertunorderedlist' , false , null ) ;
226
+ expect ( element . html ( ) ) . toBe ( '<ul><li>To the List!</li><li>To the List!</li></ul>' ) ;
227
+ } ) ) ;
228
+ } ) ;
201
229
describe ( 'from ol' , function ( ) {
202
230
describe ( 'as child of ta-bind' , function ( ) {
203
231
it ( 'to default' , inject ( function ( taSelection , taExecCommand ) {
0 commit comments