mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 13:17:08 +00:00
lint
This commit is contained in:
parent
f2d97af122
commit
1b27b4b3a3
@ -229,10 +229,12 @@ pub async fn js_read_feed(url: String, options: ReadFeedOptions) -> Result<FeedR
|
||||
.map(|v| v.to_string()),
|
||||
}),
|
||||
Err(err) => Err(err),
|
||||
},
|
||||
false => {
|
||||
Err(JsError::new(Status::Unknown, "Feed exceeded maximum size"))
|
||||
}
|
||||
false => Err(JsError::new(Status::Unknown, "Feed exceeded maximum size"))
|
||||
}
|
||||
},
|
||||
}
|
||||
Err(err) => Err(JsError::new(Status::Unknown, err)),
|
||||
},
|
||||
StatusCode::NOT_MODIFIED => Ok(FeedResult {
|
||||
|
@ -40,7 +40,7 @@ describe("IntentUtils", () => {
|
||||
expect(hasInvited).to.be.true;
|
||||
});
|
||||
|
||||
it("invites the user to the room and joins", () => {
|
||||
it("should fail if the bot was not invited to the room", () => {
|
||||
const targetIntent = IntentMock.create(SENDER_USER_ID);
|
||||
const matrixClient = MatrixClientMock.create();
|
||||
|
||||
|
@ -118,17 +118,35 @@ describe("Config/BridgePermissions", () => {
|
||||
)
|
||||
).to.be.false;
|
||||
});
|
||||
const checkActorValues = ["@foo:bar", "bar", "*"];
|
||||
checkActorValues.forEach(actor => {
|
||||
it(`will return true for a service defintion of '${actor}' that has a sufficent level`, () => {
|
||||
const bridgePermissions = genBridgePermissions("@foo:bar", "fake-service", "commands");
|
||||
expect(
|
||||
bridgePermissions.checkActionAny(
|
||||
"@foo:bar",
|
||||
"commands"
|
||||
)
|
||||
).to.be.true;
|
||||
});
|
||||
|
||||
it(`will check that a userId actor has a sufficent level`, () => {
|
||||
const bridgePermissions = genBridgePermissions("@foo:bar", "fake-service", "commands");
|
||||
expect(
|
||||
bridgePermissions.checkActionAny(
|
||||
"@foo:bar",
|
||||
"commands"
|
||||
)
|
||||
).to.be.true;
|
||||
});
|
||||
|
||||
it(`will check that a homeserver actor has a sufficent level`, () => {
|
||||
const bridgePermissions = genBridgePermissions("bar", "fake-service", "commands");
|
||||
expect(
|
||||
bridgePermissions.checkActionAny(
|
||||
"@foo:bar",
|
||||
"commands"
|
||||
)
|
||||
).to.be.true;
|
||||
});
|
||||
|
||||
it(`will check that a wildcard actor has a sufficent level`, () => {
|
||||
const bridgePermissions = genBridgePermissions("*", "fake-service", "commands");
|
||||
expect(
|
||||
bridgePermissions.checkActionAny(
|
||||
"@foo:bar",
|
||||
"commands"
|
||||
)
|
||||
).to.be.true;
|
||||
});
|
||||
})
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user