DEV: Refactor JS acceptance tests

This commit is contained in:
David Taylor 2018-09-12 18:35:50 +01:00
parent 6824411b8b
commit 8d93b68f80
1 changed files with 1 additions and 11 deletions

View File

@ -2,13 +2,12 @@ import { acceptance } from "helpers/qunit-helpers";
acceptance("Chat Integration", { acceptance("Chat Integration", {
loggedIn: true, loggedIn: true,
beforeEach() { pretend(server) {
const response = object => { const response = object => {
return [200, { "Content-Type": "text/html; charset=utf-8" }, object]; return [200, { "Content-Type": "text/html; charset=utf-8" }, object];
}; };
server.get("/admin/plugins/chat/providers", () => { server.get("/admin/plugins/chat/providers", () => {
// eslint-disable-line no-undef
return response({ return response({
providers: [ providers: [
{ {
@ -21,7 +20,6 @@ acceptance("Chat Integration", {
}); });
server.get("/admin/plugins/chat/channels", () => { server.get("/admin/plugins/chat/channels", () => {
// eslint-disable-line no-undef
return response({ return response({
channels: [ channels: [
{ {
@ -46,42 +44,34 @@ acceptance("Chat Integration", {
}); });
server.post("/admin/plugins/chat/channels", () => { server.post("/admin/plugins/chat/channels", () => {
// eslint-disable-line no-undef
return response({}); return response({});
}); });
server.put("/admin/plugins/chat/channels/:id", () => { server.put("/admin/plugins/chat/channels/:id", () => {
// eslint-disable-line no-undef
return response({}); return response({});
}); });
server.delete("/admin/plugins/chat/channels/:id", () => { server.delete("/admin/plugins/chat/channels/:id", () => {
// eslint-disable-line no-undef
return response({}); return response({});
}); });
server.post("/admin/plugins/chat/rules", () => { server.post("/admin/plugins/chat/rules", () => {
// eslint-disable-line no-undef
return response({}); return response({});
}); });
server.put("/admin/plugins/chat/rules/:id", () => { server.put("/admin/plugins/chat/rules/:id", () => {
// eslint-disable-line no-undef
return response({}); return response({});
}); });
server.delete("/admin/plugins/chat/rules/:id", () => { server.delete("/admin/plugins/chat/rules/:id", () => {
// eslint-disable-line no-undef
return response({}); return response({});
}); });
server.post("/admin/plugins/chat/test", () => { server.post("/admin/plugins/chat/test", () => {
// eslint-disable-line no-undef
return response({}); return response({});
}); });
server.get("/groups/search.json", () => { server.get("/groups/search.json", () => {
// eslint-disable-line no-undef
return response([]); return response([]);
}); });
} }