Skip to content

Commit

Permalink
Set shouldPush to false to reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine committed Dec 4, 2024
1 parent 5b3d404 commit 09a4af8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
20 changes: 2 additions & 18 deletions content-types/content-type-reaction/src/Reaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,8 @@ describe("ReactionContentType", () => {
expect(messageContent.schema).toBe("shortcode");
});

it("has a proper shouldPush value based on content", () => {
it("has a proper shouldPush value", () => {
const codec = new ReactionCodec();

const addReaction: Reaction = {
action: "added",
content: "smile",
reference: "foo",
schema: "shortcode",
};

const removeReaction: Reaction = {
action: "removed",
content: "smile",
reference: "foo",
schema: "shortcode",
};

expect(codec.shouldPush(addReaction)).toBe(true);
expect(codec.shouldPush(removeReaction)).toBe(false);
expect(codec.shouldPush()).toBe(false);
});
});
4 changes: 2 additions & 2 deletions content-types/content-type-reaction/src/Reaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class ReactionCodec
}
}

shouldPush(content: Reaction): boolean {
return content.action === "added";
shouldPush(): boolean {
return false;
}
}

0 comments on commit 09a4af8

Please sign in to comment.