client/src/api/__tests__/WebAnnotationSerializer.test.js
changeset 102 b0e36664f1f2
parent 98 2e939d9cf193
--- a/client/src/api/__tests__/WebAnnotationSerializer.test.js	Wed Jun 28 12:54:48 2017 +0200
+++ b/client/src/api/__tests__/WebAnnotationSerializer.test.js	Wed Jun 28 13:29:07 2017 +0200
@@ -8,7 +8,11 @@
     "key": "keyword",
     "name": "Mot-clé",
     "color": "#2ECC71",
-    "text": "Foo"
+    "text": "Foo",
+    "selection": {
+      "start": 0,
+      "end": 10,
+    },
   };
 
   const comment = {
@@ -17,7 +21,11 @@
     "color": "#3498DB",
     "hasComment": true,
     "comment": "Bar",
-    "text": "Baz"
+    "text": "Baz",
+    "selection": {
+      "start": 0,
+      "end": 10,
+    },
   }
 
   const note = new Note({
@@ -45,10 +53,17 @@
       "id": 0,
       "target": {
         "source": "/session/9876543/notes/123456",
-        "selector": {
-          "type": "TextQuoteSelector",
-          "exact": "Foo"
-        }
+        "selector": [
+          {
+            "type": "TextQuoteSelector",
+            "exact": "Foo"
+          },
+          {
+            "type": "TextPositionSelector",
+            "start": 0,
+            "end": 10
+          }
+        ]
       }
     },
     {
@@ -62,10 +77,17 @@
       },
       "target": {
         "source": "/session/9876543/notes/123456",
-        "selector": {
-          "type": "TextQuoteSelector",
-          "exact": "Baz"
-        }
+        "selector": [
+          {
+            "type": "TextQuoteSelector",
+            "exact": "Baz"
+          },
+          {
+            "type": "TextPositionSelector",
+            "start": 0,
+            "end": 10
+          }
+        ]
       }
     }
   ];