Skip to content

Commit

Permalink
addressing review
Browse files Browse the repository at this point in the history
  • Loading branch information
Reptapog authored and essential-randomness committed Sep 22, 2023
1 parent 9a3b967 commit bfdba50
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 0 additions & 4 deletions server/feeds/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ router.get("/realms/:realm_id", ensureLoggedIn, async (req, res) => {
});
info(`Found activity for realm ${realmExternalId}:`, result);

if (result === false) {
res.sendStatus(500);
return;
}
if (!result) {
throw new NotFound404Error(
`Realm with id ${realmExternalId} was not found`
Expand Down
2 changes: 1 addition & 1 deletion server/feeds/tests/REST/REST-realm-feed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const log = debug("bobaserver:board:routes");
expect(res.body).toEqual(BOBATAN_REALM_FEED);
});

test("return realm activity results when user isn't logged in", async () => {
test("should return 401 when user isn't logged in", async () => {
const res = await request(server.app).get(`/realms/${TWISTED_MINDS_REALM_EXTERNAL_ID}`);

expect(res.status).toBe(401);
Expand Down
5 changes: 3 additions & 2 deletions server/feeds/tests/queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BOBATAN_USER_ID, ONCEST_USER_ID } from "test/data/auth";
import {
FAVORITE_CHARACTER_THREAD_ID,
FAVORITE_MURDER_THREAD_ID,
FUNNY_MEMES_THREAD_ID,
} from "test/data/threads";

import { TWISTED_MINDS_REALM_EXTERNAL_ID } from "test/data/realms";
Expand Down Expand Up @@ -83,7 +84,7 @@ describe("feed activity queries", () => {
new_posts_amount: 0,
post_id: "b2c57275-512e-4821-8cf8-b3ac76e1e044",
posts_amount: 136,
thread_id: "2765f36a-b4f9-4efe-96f2-cb34f055d032", // Meme Thread Id
thread_id: FUNNY_MEMES_THREAD_ID,
thread_last_activity_at: "2020-08-22T03:36:55.00Z",
thread_last_activity_at_micro: "2020-08-22T03:36:55.850000",
threads_amount: 135,
Expand Down Expand Up @@ -161,7 +162,7 @@ describe("feed activity queries", () => {
new_posts_amount: 0,
post_id: "b2c57275-512e-4821-8cf8-b3ac76e1e044",
posts_amount: 136,
thread_id: "2765f36a-b4f9-4efe-96f2-cb34f055d032", // Meme Thread Id
thread_id: FUNNY_MEMES_THREAD_ID,
thread_last_activity_at: "2020-08-22T03:36:55.00Z",
thread_last_activity_at_micro: "2020-08-22T03:36:55.850000",
threads_amount: 135,
Expand Down
7 changes: 4 additions & 3 deletions server/feeds/tests/user-feed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BOBATAN_USER_ID, ONCEST_USER_ID } from "test/data/auth";
import {
FAVORITE_CHARACTER_THREAD_ID,
FAVORITE_MURDER_THREAD_ID,
FUNNY_MEMES_THREAD_ID,
} from "test/data/threads";

import { TWISTED_MINDS_REALM_EXTERNAL_ID } from "test/data/realms";
Expand Down Expand Up @@ -74,7 +75,7 @@ describe("feed activity queries", () => {
new_posts_amount: 0,
post_id: "b2c57275-512e-4821-8cf8-b3ac76e1e044",
posts_amount: 136,
thread_id: "2765f36a-b4f9-4efe-96f2-cb34f055d032", // Meme Thread Id
thread_id: FUNNY_MEMES_THREAD_ID,
thread_last_activity_at: "2020-08-22T03:36:55.00Z",
thread_last_activity_at_micro: "2020-08-22T03:36:55.850000",
threads_amount: 135,
Expand Down Expand Up @@ -160,7 +161,7 @@ describe("feed activity queries", () => {
new_posts_amount: 0,
post_id: "b2c57275-512e-4821-8cf8-b3ac76e1e044",
posts_amount: 136,
thread_id: "2765f36a-b4f9-4efe-96f2-cb34f055d032", // Meme Thread Id
thread_id: FUNNY_MEMES_THREAD_ID,
thread_last_activity_at: "2020-08-22T03:36:55.00Z",
thread_last_activity_at_micro: "2020-08-22T03:36:55.850000",
threads_amount: 135,
Expand Down Expand Up @@ -252,7 +253,7 @@ describe("feed activity queries", () => {
new_posts_amount: 0,
post_id: "b2c57275-512e-4821-8cf8-b3ac76e1e044",
posts_amount: 136,
thread_id: "2765f36a-b4f9-4efe-96f2-cb34f055d032", // Meme Thread Id
thread_id: FUNNY_MEMES_THREAD_ID,
thread_last_activity_at: "2020-08-22T03:36:55.00Z",
thread_last_activity_at_micro: "2020-08-22T03:36:55.850000",
threads_amount: 135,
Expand Down

0 comments on commit bfdba50

Please sign in to comment.