You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it("Will prompt for the policy list when it is missing",asyncfunction(){const{ protectedRoomsSet, policyRoomManager }=awaitcreateProtectedRooms();constbanResult=awaitCommandExecutorHelper.parseAndInvoke(DraupnirBanCommand,{
policyRoomManager,
roomResolver,issuerManager: protectedRoomsSet.issuerManager,defaultReasons: ["spam"],clientUserID: `@draupnir:ourserver.example.com`asStringUserID,},{},MatrixUserIDPresentationType.wrap(MatrixUserID.fromUserID("@spam:spam.example.com"asStringUserID)),undefined,// no policy room provided, we expect a prompt.);if(isOk(banResult)){thrownewTypeError(`We expect a prompt error to be returned`);}if(!(banResult.errorinstanceofPromptRequiredError)){thrownewTypeError(`Expected to have a prompt required error`)}expect(banResult.error.parameterRequiringPrompt.name).toBe("list");});
Would mean a test like this could also test that the prompt had been called properly.
The text was updated successfully, but these errors were encountered:
Ok, it turns out that we need to do this now anyways, because stream.isPromptable() will never work as we keep recreating streams out of thin air in the parsing code.
We will call the prompt whenever one is available and show the suggestions in the error message, much like the An argument for the parameter ${parameter.name} was expected but was not provided.
Ok, the problem with doing that is it means we would have to pass the executor context all the way through to the parsing code which will be ugly. So I think we just change to PromptRequiredError by default and then something else can call them later.
Would mean a test like this could also test that the prompt had been called properly.
The text was updated successfully, but these errors were encountered: