mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-28 23:31:21 +00:00
cleanup
This commit is contained in:
parent
1001e3f67a
commit
ff2a7c5136
2 changed files with 13 additions and 17 deletions
|
@ -34,6 +34,7 @@ import {
|
|||
longDelay,
|
||||
editCommunity,
|
||||
unfollows,
|
||||
allowInstance,
|
||||
} from "./shared";
|
||||
import { EditCommunity, EditSite } from "lemmy-js-client";
|
||||
|
||||
|
@ -455,9 +456,12 @@ test("Dont receive community activities after unsubscribe", async () => {
|
|||
expect(communityRes1.community_view.counts.subscribers).toBe(2);
|
||||
|
||||
// temporarily block alpha, so that it doesn't know about unfollow
|
||||
let editSiteForm: EditSite = {};
|
||||
editSiteForm.allowed_instances = ["lemmy-epsilon"];
|
||||
await beta.editSite(editSiteForm);
|
||||
var allow_instance_params: AdminAllowInstanceParams = {
|
||||
instance: "lemmy-alpha",
|
||||
allow: false,
|
||||
reason: undefined,
|
||||
};
|
||||
await beta.adminAllowInstance(allow_instance_params);
|
||||
await longDelay();
|
||||
|
||||
// unfollow
|
||||
|
@ -471,8 +475,8 @@ test("Dont receive community activities after unsubscribe", async () => {
|
|||
expect(communityRes2.community_view.counts.subscribers).toBe(2);
|
||||
|
||||
// unblock alpha
|
||||
editSiteForm.allowed_instances = betaAllowedInstances;
|
||||
await beta.editSite(editSiteForm);
|
||||
allow_instance_params.allow = true;
|
||||
await beta.adminAllowInstance(allow_instance_params);
|
||||
await longDelay();
|
||||
|
||||
// create a post, it shouldnt reach beta
|
||||
|
|
|
@ -105,13 +105,6 @@ export const gamma = new LemmyHttp(gammaUrl, { fetchFunction });
|
|||
export const delta = new LemmyHttp(deltaUrl, { fetchFunction });
|
||||
export const epsilon = new LemmyHttp(epsilonUrl, { fetchFunction });
|
||||
|
||||
export const betaAllowedInstances = [
|
||||
"lemmy-alpha",
|
||||
"lemmy-gamma",
|
||||
"lemmy-delta",
|
||||
"lemmy-epsilon",
|
||||
];
|
||||
|
||||
const password = "lemmylemmy";
|
||||
|
||||
export async function setupLogins() {
|
||||
|
@ -175,7 +168,7 @@ export async function setupLogins() {
|
|||
await delta.editSite(editSiteForm);
|
||||
await epsilon.editSite(editSiteForm);
|
||||
|
||||
// Set the blocksfor each
|
||||
// Set the blocks for each
|
||||
await allowInstance(alpha, "lemmy-beta");
|
||||
await allowInstance(alpha, "lemmy-gamma");
|
||||
await allowInstance(alpha, "lemmy-delta");
|
||||
|
@ -209,12 +202,11 @@ export async function setupLogins() {
|
|||
}
|
||||
}
|
||||
|
||||
async function allowInstance(
|
||||
api: LemmyHttp,instance: string) {
|
||||
export async function allowInstance(api: LemmyHttp, instance: string) {
|
||||
const params: AdminAllowInstanceParams = {
|
||||
instance,
|
||||
allow: true,
|
||||
reason: undefined
|
||||
reason: undefined,
|
||||
};
|
||||
await api.adminAllowInstance(params);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue