Skip to content

Commit 08bbb51

Browse files
committed
test: merge allowlist resolution coverage
1 parent f5a23b7 commit 08bbb51

2 files changed

Lines changed: 17 additions & 18 deletions

File tree

src/plugin-sdk/allow-from.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
formatNormalizedAllowFromEntries,
55
isAllowedParsedChatSender,
66
isNormalizedSenderAllowed,
7+
mapAllowlistResolutionInputs,
78
} from "./allow-from.js";
89

910
function parseAllowTarget(
@@ -144,3 +145,19 @@ describe("formatNormalizedAllowFromEntries", () => {
144145
expect(formatNormalizedAllowFromEntries(input)).toEqual(expected);
145146
});
146147
});
148+
149+
describe("mapAllowlistResolutionInputs", () => {
150+
it("maps inputs sequentially and preserves order", async () => {
151+
const visited: string[] = [];
152+
const result = await mapAllowlistResolutionInputs({
153+
inputs: ["one", "two", "three"],
154+
mapInput: async (input) => {
155+
visited.push(input);
156+
return input.toUpperCase();
157+
},
158+
});
159+
160+
expect(visited).toEqual(["one", "two", "three"]);
161+
expect(result).toEqual(["ONE", "TWO", "THREE"]);
162+
});
163+
});

src/plugin-sdk/allowlist-resolution.test.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)