Unit tests for avatars¶WebODF already has a number of unit test files for carets and selections. These are in
Only the CaretTests file is currently run. It has no tests. The tests in that file would be intended for testing gui.Caret.
To test the avatars, first the task of the avatars should be clear. Avatars represent position of a user in a text. This position can be one point, a range (selection) or a number of ranges (multiple selection one can often do by dragging some areas while holding ctrl button). In addition, an avatar has a graphical representation. This can depend on the state. Each range has a start and an end which could be represented differently. E.g. the end could have a pulsating caret.
In the DOM this interface is defined by the Selection interface for most browsers.
A selection consists of ranges which have been specified for some time:
The SelectionMover class is close to what an Avatar should be.
The ranges are not represented when the document is serialized. The positions should not be part of the main document but be part of the surrounding session information of which the document is a part. This has not yet been defined. If we want to keep that updated, we need to define that too, so there can be documents for it.