Skip to content

Commit b40590a

Browse files
authored
Merge pull request #46 from JoinTheAlliance/0.0.28
fix tests and expand scope of tests
2 parents a953f35 + 0083658 commit b40590a

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

Diff for: .github/workflows/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- uses: actions/setup-node@v2
2121

2222
- run: npm ci
23-
- run: npm run test -- ./src/lib/ --runInBand
23+
- run: npm run test

Diff for: src/lib/__tests__/messages.test.ts

+3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ describe("Messages Library", () => {
3535
});
3636

3737
test("formatActors should format actors into a readable string", () => {
38+
console.log("*** actors", actors);
3839
const formattedActors = formatActors({ actors });
40+
console.log("*** formattedActors", formattedActors);
3941
actors.forEach((actor) => {
42+
console.log("*** actor.name", actor.name);
4043
expect(formattedActors).toContain(actor.name);
4144
});
4245
});

Diff for: src/lib/actions/__tests__/continue.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Content, type Message } from "../../types";
1010
import action from "../continue";
1111
import ignore from "../ignore";
1212
import { zeroUuid } from "../../constants";
13+
import wait from "../wait";
1314

1415
dotenv.config({ path: ".dev.vars" });
1516

@@ -52,7 +53,7 @@ describe("User Profile", () => {
5253
beforeAll(async () => {
5354
const setup = await createRuntime({
5455
env: process.env as Record<string, string>,
55-
actions: [action, ignore],
56+
actions: [action, ignore, wait],
5657
});
5758
user = setup.session.user;
5859
runtime = setup.runtime;

Diff for: src/lib/actions/__tests__/ignore.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ describe("Ignore action tests", () => {
190190
senderId: user?.id as UUID,
191191
agentId: zeroUuid,
192192
userIds: [user?.id as UUID, zeroUuid],
193-
content: { content: "Never talk to me again" },
193+
content: { content: "Never talk to me again", action: "WAIT" },
194194
room_id: room_id as UUID,
195195
};
196196

@@ -212,7 +212,7 @@ describe("Ignore action tests", () => {
212212
senderId: user.id as UUID,
213213
agentId: zeroUuid,
214214
userIds: [user?.id as UUID, zeroUuid],
215-
content: { content: "" },
215+
content: { content: "", action: "IGNORE" },
216216
room_id: room_id as UUID,
217217
};
218218

@@ -239,7 +239,7 @@ describe("Ignore action tests", () => {
239239
senderId: user.id as UUID,
240240
agentId: zeroUuid,
241241
userIds: [user?.id as UUID, zeroUuid],
242-
content: { content: "" },
242+
content: { content: "", action: "IGNORE" },
243243
room_id: room_id as UUID,
244244
};
245245

@@ -264,7 +264,7 @@ describe("Ignore action tests", () => {
264264
senderId: user.id as UUID,
265265
agentId: zeroUuid,
266266
userIds: [user?.id as UUID, zeroUuid],
267-
content: { content: "Bye" },
267+
content: { content: "Bye", action: "WAIT" },
268268
room_id: room_id as UUID,
269269
};
270270

Diff for: src/lib/messages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function getActorDetails({
4242
*/
4343
export function formatActors({ actors }: { actors: Actor[] }) {
4444
const actorStrings = actors.map((actor: Actor) => {
45-
const header = `${actor.name}${actor.details.tagline ? ": " + actor.details.tagline : ""}\n${actor.details.summary || "No information available"}`;
45+
const header = `${actor.name}${actor.details.tagline ? ": " + actor.details.tagline : ""}${actor.details?.summary ? "\n" + actor.details?.summary : ""}`;
4646
return header;
4747
});
4848
const finalActorStrings = actorStrings.join("\n");

Diff for: src/test/constants.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export const SUPABASE_ANON_KEY =
44
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InByb252enJ6ZndzcHRrb2p2dWRkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDY4NTYwNDcsImV4cCI6MjAyMjQzMjA0N30.I6_-XrqssUb2SWYg5DjsUqSodNS3_RPoET3-aPdqywM";
55
export const TEST_EMAIL = "[email protected]";
66
export const TEST_PASSWORD = "[email protected]";
7-
export const TEST_EMAIL_2 = "testuser123@gmail.com";
8-
export const TEST_PASSWORD_2 = "testuser123@gmail.com";
7+
export const TEST_EMAIL_2 = "testuser234@gmail.com";
8+
export const TEST_PASSWORD_2 = "testuser234@gmail.com";

0 commit comments

Comments
 (0)