From 0ac33c89457136e294fa2132c7f91b324122ed06 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 7 Feb 2023 14:12:28 -0500 Subject: [PATCH] Add some comments about tests. --- spec/unit/pushprocessor.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/unit/pushprocessor.spec.ts b/spec/unit/pushprocessor.spec.ts index f12a0fc9fb4..682a863594c 100644 --- a/spec/unit/pushprocessor.spec.ts +++ b/spec/unit/pushprocessor.spec.ts @@ -287,6 +287,7 @@ describe("NotificationService", function () { expect(actions.tweaks.highlight).toEqual(true); }); + // TODO: This is not spec compliant behaviour. it("should bing on character group ([abc]) bing words.", function () { testEvent.event.content!.body = "Ping!"; let actions = pushProcessor.actionsForEvent(testEvent); @@ -296,12 +297,14 @@ describe("NotificationService", function () { expect(actions.tweaks.highlight).toEqual(true); }); + // TODO: This is not spec compliant behaviour. it("should bing on character range ([a-z]) bing words.", function () { testEvent.event.content!.body = "I ate 6 pies"; const actions = pushProcessor.actionsForEvent(testEvent); expect(actions.tweaks.highlight).toEqual(true); }); + // TODO: This is not spec compliant behaviour. it("should bing on character negation ([!a]) bing words.", function () { testEvent.event.content!.body = "boke"; let actions = pushProcessor.actionsForEvent(testEvent); @@ -330,6 +333,8 @@ describe("NotificationService", function () { // invalid it("should gracefully handle bad input.", function () { + // The following body is an object (not a string) and thus is invalid + // for matching against. testEvent.event.content!.body = { foo: "bar" }; const actions = pushProcessor.actionsForEvent(testEvent); expect(actions.tweaks.highlight).toEqual(false);