@rr0/cms 0.3.78 → 0.3.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,6 +47,10 @@ export class DataContentVisitor {
47
47
  await this.processDeath(context, event, data);
48
48
  break;
49
49
  case "sighting":
50
+ // An analyst's reading of one of the case's sightings (a UFO@home interpretation: bodies in
51
+ // metres, which the player stands in the scene and measures against the account). Nothing
52
+ // to write in the page: the player reads it from the case.json, so it only needs the player.
53
+ case "interpretation":
50
54
  this.processSighting(context, data);
51
55
  break;
52
56
  default:
@@ -50,6 +50,16 @@ describe("DataContentVisitor", () => {
50
50
  // Nothing else: no dated paragraph per sighting, which a sighting without a time used to fail the build on.
51
51
  expect(context.file.document.querySelectorAll(".contents > p").length).toBe(1);
52
52
  });
53
+ test("shows an analyst's interpretation through the same player, and writes nothing else", async () => {
54
+ const interpretation = { type: "event", eventType: "interpretation", sighting: "2015-05-31-T1", by: [{ org: "GEIPAN" }] };
55
+ const context = cmsTestUtil.newHtmlContext("people/v/VertongenJeanLuc/index.html", "<div class=\"contents\"><p>Le dossier</p></div>");
56
+ const visitor = new TestDataContentVisitor();
57
+ await visitor.renderEvent(context, sightingEvent, aCase);
58
+ // No time: it used to fail the build, then to be appended outside the page.
59
+ await visitor.renderEvent(context, interpretation, aCase);
60
+ expect(context.file.document.querySelectorAll(".contents > rr0-sighting").length).toBe(1);
61
+ expect(context.file.document.querySelectorAll("p").length).toBe(1);
62
+ });
53
63
  test("leaves a player the page's author placed alone", async () => {
54
64
  const context = cmsTestUtil.newHtmlContext("people/v/VertongenJeanLuc/index.html", "<div class=\"contents\"><p>Le dossier</p><rr0-sighting src=\"case.json\" show-witness-map></rr0-sighting></div>");
55
65
  const visitor = new TestDataContentVisitor();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@rr0/cms",
3
3
  "type": "module",
4
4
  "author": "Jérôme Beau <rr0@rr0.org> (https://rr0.org)",
5
- "version": "0.3.78",
5
+ "version": "0.3.79",
6
6
  "description": "RR0 Content Management System (CMS)",
7
7
  "exports": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@javarome/fileutil": "^0.3.9",
33
33
  "@rr0/common": "^1.1.5",
34
- "@rr0/data": "^0.3.45",
34
+ "@rr0/data": "^0.3.46",
35
35
  "@rr0/lang": "^0.1.13",
36
36
  "@rr0/place": "^0.5.4",
37
37
  "@rr0/time": "^0.11.3",