-
-
Notifications
You must be signed in to change notification settings - Fork 140
Mock actor setters do not chain #1098
Copy link
Copy link
Open
Labels
component/testingTesting utilities (@fedify/testing)Testing utilities (@fedify/testing)difficulty/beginnerBeginner friendlyBeginner friendlygood first issueGood for newcomersGood for newcomers
Description
Activity
Metadata
Metadata
Assignees
Labels
component/testingTesting utilities (@fedify/testing)Testing utilities (@fedify/testing)difficulty/beginnerBeginner friendlyBeginner friendlygood first issueGood for newcomersGood for newcomers
Type
Fields
Priority
None yet
Effort
None yet
Background
MockFederation.setActorDispatcher()in packages/testing/src/mock.ts returns an object whosesetKeyPairsDispatcher(),mapHandle(),mapAlias(), andauthorize()return theMockFederationitself instead of the setters object. Other mock setters, such as those returned bysetObjectDispatcher()and the collection dispatchers, return the federation fromauthorize()in the same way.So code that chains setters, as the
FederationAPI allows, fails against the mock:mapPortableActorId(), added in #840, already returns the setters object, as does the real implementation. The actor setters also lackmapActorAlias().Proposed work
Make every setters object that the mock returns return itself from its methods, and add the missing
mapActorAlias().Tests
authorize()on object and collection setters;