Commit graph

26 commits

Author SHA1 Message Date
Catrope bcd7431818 Remove getScope(), no longer used
Change-Id: I79e067a8e6b3eb151d3ebe1dfc3aaebe242aed39
2012-05-16 20:16:47 -07:00
Trevor Parscal 0c69370117 Added merge test for ve.dm.TransactionProcessor
Also added 2 paragraphs at the end of the example document and updated related tests accordingly

Change-Id: Idd294cbe3975d0a04069e55682a91417160e538a
2012-05-16 13:33:42 -07:00
Trevor Parscal 6d0a24bec6 Greatly simplified selection and node tree comparison tests
By first summarizing a node tree or node selection and then using the normal deepEqual function we are able to take advantage of native QUnit functionality to make diagnosing a problem easier under failing conditions and reduce the verbosity of the output under passing conditions.

Change-Id: I4af5d69596cf5459aa32f61ee6d5b8355233c3df
2012-05-15 00:25:27 -07:00
Catrope cdda5e7920 Improve verbosity of selectNodes test descriptions
* Make nodeSelectionEqual() accept a desc parameter and use it for
  building descriptions
* Put the array element number in the desciption too
* Add descriptions for selectNodes tests and pass them through

Change-Id: Icd2894d11516234598cbd984cc8d88f705bfc1d6
2012-05-14 22:54:53 -07:00
Catrope 0f0c3c9939 Improvements to nodeTreeEqual():
* Don't crash if b.children has a different length than expected
* Don't crash if b.children is absent but expected
* Check if b.children is present when it's not expected
* Add assertion when neither a.children not b.children are present; this
  makes the number of assertions for leaves equal to the number of
  assertions for branches
* Check attributes too
* Accept a desc parameter, and add node paths (like
  list/listItem/paragraph/text) to the descriptions
* Use desc parameter for all calls (some tests were already using it,
  even though it didn't actually exist)

Change-Id: Ic56d27d20377e7f4fdfa038fdf4ebe00dcb3e062
2012-05-14 22:43:36 -07:00
Catrope 5b9a2645a6 Port getScope() from the old VE code and add tests for it
Change-Id: I8c34fed919e60fa1b8cb6a13cb9ca98f3e695421
2012-05-11 16:03:46 -07:00
Trevor Parscal 9cdfb84f9b Added tests to getRelativeContentOffset
Also fixed a typo in the implementation

Change-Id: I86855795009e34d42a3a5857addc5ccb6366130f
2012-05-11 12:14:29 -07:00
Trevor Parscal 1475100a22 Ported isContentOffset, isStructuralOffset, isElementData, containsElementData and getRelativeContentOffset
Tests for all but getRelativeContentOffset are done too

Change-Id: Iee953647ec89e13259ae2a402c50c809f93bc655
2012-05-10 17:20:57 -07:00
Trevor Parscal 1798a478e7 Massive refactor of node trees, generalizing lots of previously dm only stuff
Change-Id: I9dbb7094f86338ea2e725ad29f66e9e4ca2b52ed
2012-05-09 21:11:09 -07:00
Trevor Parscal b4478216be Added tests for document synchronizer
Change-Id: If114e3fc962598f7ea8f7f8ec8975a3b0d2d83e6
2012-05-09 18:31:09 -07:00
Trevor Parscal 89a2b1bc40 Fixed naming in test moved from ve.dm.DocumentFragment to ve.dm.Document
Change-Id: I6843e452b0222632d1d244568bd75f3b229b4954
2012-05-09 15:30:18 -07:00
Trevor Parscal c017d7421c Removed use of expected in conjunction with ve.dm.example.*Equal methods
Change-Id: I48108f3fac7dda32344e105b7c52483cd2a84ef9
2012-05-09 15:28:06 -07:00
Catrope 22c88f77c3 Add a 'siblings' mode to selectNodes(), and add tests for it
Change-Id: Ib3fd3ee5aba7aab7c26193a2a9c48612f624862a
2012-05-08 18:31:50 -07:00
Trevor Parscal 123c64cbd5 Added more tests for selectNodes
Change-Id: Ibd9672fb9b6ce682905d20f9346fada6fb47b380
2012-05-07 19:03:59 -07:00
Catrope 4d9299b808 Fix bugs in selectNodes(), tests pass now
Also fix one instance of bad expected data in a selectNodes test

Change-Id: Ie226b237cf537143bce2f6b1e531b9067b140cb4
2012-05-07 17:03:42 -07:00
Catrope 32c65cdaa8 Change 'leaf' to 'leaves' and document it
Change-Id: I09d5995d3d9bf82670802f0efe849f40be2a18a3
2012-05-07 17:03:42 -07:00
Catrope 770775eec0 Fix rebuildNodes tests, were messing up ve.dm.example
Fixed by operating on a copy of the data instead

Change-Id: Ia2607d94f07b8d43e8c98ae8a94c34df90081508
2012-05-07 17:03:42 -07:00
Trevor Parscal 4bae026190 Added additional test to rebuildNodes, now testing rebuilding after a change
Change-Id: I669457389bf742c100dec5205b972f6d1e14ef44
2012-05-07 16:25:39 -07:00
Trevor Parscal 811110d7c6 Simplified selectNode tests
Change-Id: I878fd430b24661fc11c953b3303e395cdd617006
2012-05-07 16:18:24 -07:00
Trevor Parscal 88a05b5606 Added another falling selectNodes test
Change-Id: I1f18b0af956c98a5facaf12a88fd94ca76e50a65
2012-05-07 16:05:40 -07:00
Trevor Parscal e1f8fef228 Changed selectNodes test to desired behavior (which fails atm)
Change-Id: I79eb5caaa3e2193e2309d37dc1d0ca67c2602836
2012-05-07 15:50:11 -07:00
Trevor Parscal f4fcf9663e Added documentation and tests for ve.dm.Document.selectNodes
Also:
* Broke node lookup method out into ve.dm.example.lookupNode
* Added ve.dm.example.nodeSelectionEqual

Change-Id: I437cdd3f3154d10782f03f78df6d5c457ecfc845
2012-05-07 15:15:21 -07:00
Trevor Parscal 9887dbd96f Split Broke DefinitionListNode out of ListNode and DefinitionListItemNode out of ListItemNode
* Makes it simpler in the linear model because we don't have to use style: "item" for regular list items and style: "definition" for definition lists
* Enforces correct nesting through existing node rules systems
* Updates tests accordingly

Change-Id: I64d80af938e325f1961226505bdc386bb35ccdda
2012-05-04 11:56:32 -07:00
Trevor Parscal 93390847bc Added getOuterLength tests for text and document nodes
Neither of these nodes have elements around them, so they must override the default behavior of ve.dm.Node

Change-Id: I19c02c210bfc04b6e2ee1a37b8890e84a236eee3
2012-04-30 13:48:20 -07:00
Trevor Parscal 0d4fb6fdb5 Got rebuildNodes tests working
* Moved node tree assertion to ve.dm.example
* Added rebuildNodes test
* Fixed some typos in rebuildNodes

Change-Id: I4853ded4b062aaa3758435093368bc23667ca3bf
2012-04-30 13:42:32 -07:00
Trevor Parscal 44fe109f14 Added test data and fixed test suite links
Change-Id: Idb5de70b58c525a67f16b21f7adc53214af9b486
2012-04-27 14:59:52 -07:00