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()),
|
.map(|v| v.to_string()),
|
||||||
}),
|
}),
|
||||||
Err(err) => Err(err),
|
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)),
|
Err(err) => Err(JsError::new(Status::Unknown, err)),
|
||||||
},
|
},
|
||||||
StatusCode::NOT_MODIFIED => Ok(FeedResult {
|
StatusCode::NOT_MODIFIED => Ok(FeedResult {
|
||||||
|
@ -40,7 +40,7 @@ describe("IntentUtils", () => {
|
|||||||
expect(hasInvited).to.be.true;
|
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 targetIntent = IntentMock.create(SENDER_USER_ID);
|
||||||
const matrixClient = MatrixClientMock.create();
|
const matrixClient = MatrixClientMock.create();
|
||||||
|
|
||||||
|
@ -118,9 +118,8 @@ describe("Config/BridgePermissions", () => {
|
|||||||
)
|
)
|
||||||
).to.be.false;
|
).to.be.false;
|
||||||
});
|
});
|
||||||
const checkActorValues = ["@foo:bar", "bar", "*"];
|
|
||||||
checkActorValues.forEach(actor => {
|
it(`will check that a userId actor has a sufficent level`, () => {
|
||||||
it(`will return true for a service defintion of '${actor}' that has a sufficent level`, () => {
|
|
||||||
const bridgePermissions = genBridgePermissions("@foo:bar", "fake-service", "commands");
|
const bridgePermissions = genBridgePermissions("@foo:bar", "fake-service", "commands");
|
||||||
expect(
|
expect(
|
||||||
bridgePermissions.checkActionAny(
|
bridgePermissions.checkActionAny(
|
||||||
@ -129,6 +128,25 @@ describe("Config/BridgePermissions", () => {
|
|||||||
)
|
)
|
||||||
).to.be.true;
|
).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