From 70efed1a5881adab0eba6f2548ca7c5c49e82ca5 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 4 Mar 2022 14:03:35 +0000 Subject: [PATCH] Add test coverage around push rules with no conditions (#2219) --- spec/unit/pushprocessor.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/unit/pushprocessor.spec.js b/spec/unit/pushprocessor.spec.js index b625ade48..68480f5c7 100644 --- a/spec/unit/pushprocessor.spec.js +++ b/spec/unit/pushprocessor.spec.js @@ -302,4 +302,20 @@ describe('NotificationService', function() { const actions = pushProcessor.actionsForEvent(testEvent); expect(actions.tweaks.highlight).toEqual(false); }); + + it("a rule with no conditions matches every event.", function() { + expect(pushProcessor.ruleMatchesEvent({ + rule_id: "rule1", + actions: [], + conditions: [], + default: false, + enabled: true, + }, testEvent)).toBe(true); + expect(pushProcessor.ruleMatchesEvent({ + rule_id: "rule1", + actions: [], + default: false, + enabled: true, + }, testEvent)).toBe(true); + }); });