Unverified Commit 1fde5f33 authored by Fabien O'Carroll's avatar Fabien O'Carroll Committed by Hong Minhee
Browse files

Added breaking test for setInboxDispatcher

There is a bug where setting the inbox dispatcher after the listeners causes an
error to be thrown due to path mismatch.
parent 4a25550c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -745,6 +745,18 @@ test("Federation.setInboxDispatcher()", async (t) => {
    );
  });

  await t.step("path match", () => {
    const federation = createFederation<void>({
      kv,
      documentLoader: mockDocumentLoader,
    });
    federation.setInboxListeners("/users/{handle}/inbox");
    federation.setInboxDispatcher(
      "/users/{handle}/inbox",
      () => ({ items: [] }),
    );
  });

  await t.step("wrong variables in path", () => {
    const federation = createFederation<void>({
      kv,