mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
FIX: better message if request for report is rate limited (#6298)
This commit is contained in:
@ -130,3 +130,25 @@ componentTest("exception", {
|
||||
assert.ok(exists(".alert-error.exception"), "it displays an error");
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("rate limited", {
|
||||
beforeEach() {
|
||||
const response = object => {
|
||||
return [429, { "Content-Type": "application/json" }, object];
|
||||
};
|
||||
|
||||
// prettier-ignore
|
||||
server.get("/admin/reports/signups_rate_limited", () => { //eslint-disable-line
|
||||
return response({"errors":["You’ve performed this action too many times. Please wait 10 seconds before trying again."],"error_type":"rate_limit","extras":{"wait_seconds":10}});
|
||||
});
|
||||
},
|
||||
|
||||
template: "{{admin-report dataSourceName='signups_rate_limited'}}",
|
||||
|
||||
test(assert) {
|
||||
assert.ok(
|
||||
exists(".alert-error.rate-limited"),
|
||||
"it displays a rate limited error"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user