}
export let alpha: API = {
- client: new LemmyHttp('http://localhost:8540/api/v1'),
+ client: new LemmyHttp('http://localhost:8541/api/v1'),
};
export let beta: API = {
- client: new LemmyHttp('http://localhost:8550/api/v1'),
+ client: new LemmyHttp('http://localhost:8551/api/v1'),
};
export let gamma: API = {
- client: new LemmyHttp('http://localhost:8560/api/v1'),
+ client: new LemmyHttp('http://localhost:8561/api/v1'),
};
export let delta: API = {
- client: new LemmyHttp('http://localhost:8570/api/v1'),
+ client: new LemmyHttp('http://localhost:8571/api/v1'),
};
export let epsilon: API = {
- client: new LemmyHttp('http://localhost:8580/api/v1'),
+ client: new LemmyHttp('http://localhost:8581/api/v1'),
};
export async function setupLogins() {
community_id: number
): Promise<PostResponse> {
let name = 'A jest test post';
+ let body = 'Some body';
+ let url = 'https://google.com/';
let form: PostForm = {
name,
+ url,
+ body,
auth: api.auth,
community_id,
nsfw: false,
// Make sure lemmy-beta/c/main is cached on lemmy_alpha
// Use short-hand search url
let form: SearchForm = {
- q: '!main@lemmy-beta:8550',
+ q: '!main@lemmy-beta:8551',
+ type_: SearchType.Communities,
+ sort: SortType.TopAll,
+ };
+ return api.client.search(form);
+}
+
+export async function searchForCommunity(
+ api: API,
+ q: string,
+): Promise<SearchResponse> {
+ // Use short-hand search url
+ let form: SearchForm = {
+ q,
type_: SearchType.Communities,
sort: SortType.TopAll,
};
api: API,
name_: string = randomString(5)
): Promise<CommunityResponse> {
+ let description = 'a sample description';
+ let icon = 'https://image.flaticon.com/icons/png/512/35/35896.png';
+ let banner = 'https://image.flaticon.com/icons/png/512/35/35896.png';
let form: CommunityForm = {
name: name_,
title: name_,
+ description,
+ icon,
+ banner,
category_id: 1,
nsfw: false,
auth: api.auth,