fix(slack): guard against undefined text in includes calls during mention handling
parent
ce4faedad6
commit
2a98fd3d0b
@ -0,0 +1,20 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { stripStructuralPrefixes } from "./mentions.js";
|
||||
|
||||
describe("stripStructuralPrefixes", () => {
|
||||
it("returns empty string for undefined input at runtime", () => {
|
||||
expect(stripStructuralPrefixes(undefined as unknown as string)).toBe("");
|
||||
});
|
||||
|
||||
it("returns empty string for empty input", () => {
|
||||
expect(stripStructuralPrefixes("")).toBe("");
|
||||
});
|
||||
|
||||
it("strips sender prefix labels", () => {
|
||||
expect(stripStructuralPrefixes("John: hello")).toBe("hello");
|
||||
});
|
||||
|
||||
it("passes through plain text", () => {
|
||||
expect(stripStructuralPrefixes("just a message")).toBe("just a message");
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue