Index: trunk/parsers/wikidom/tests/hype/es.DocumentModel.test.js |
— | — | @@ -433,7 +433,7 @@ |
434 | 434 | ); |
435 | 435 | } ); |
436 | 436 | |
437 | | -test( 'es.DocumentModel.prepareInsertion', 10, function() { |
| 437 | +test( 'es.DocumentModel.prepareInsertion', 11, function() { |
438 | 438 | var documentModel = es.DocumentModel.newFromPlainObject( obj ); |
439 | 439 | |
440 | 440 | // Test 1 |
— | — | @@ -587,6 +587,18 @@ |
588 | 588 | /^Offset 29 out of bounds/, |
589 | 589 | 'prepareInsertion throws exception for offset past the end' |
590 | 590 | ); |
| 591 | + |
| 592 | + // Test 11 |
| 593 | + raises( |
| 594 | + function() { |
| 595 | + documentModel.prepareInsertion( |
| 596 | + 5, |
| 597 | + [{ 'type': 'paragraph' }, 'a', { 'type': 'listItem' }, { 'type': '/paragraph' }] |
| 598 | + ); |
| 599 | + }, |
| 600 | + /^Input is malformed: expected \/listItem but got \/paragraph at index 3$/, |
| 601 | + 'prepareInsertion throws exception for malformed input' |
| 602 | + ); |
591 | 603 | } ); |
592 | 604 | |
593 | 605 | test( 'es.DocumentModel.commit, es.DocumentModel.rollback', 10, function() { |