Skip to content

Commit 5b27c62

Browse files
committed
test(lib): assert authenticated profile
1 parent a37d618 commit 5b27c62

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

sources/lib/lib.e2e.test.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const binaryPath = resolve(process.cwd(), "dist", "bee");
1111

1212
describe("bee cli e2e", () => {
1313
e2e(
14-
"runs against real bee binary",
14+
"runs against real bee binary with authenticated profile",
1515
async () => {
1616
if (!existsSync(binaryPath)) {
1717
throw new Error(
@@ -28,10 +28,18 @@ describe("bee cli e2e", () => {
2828
const status = await bee.run(["status"]);
2929
expect(status.exitCode).toBe(0);
3030
expect(status.stdout).toContain("API:");
31-
expect(
32-
status.stdout.includes("Not logged in.") ||
33-
status.stdout.includes("Verified as")
34-
).toBe(true);
31+
expect(status.stdout).toContain("Verified as");
32+
33+
const profile = await bee.api.me<{
34+
id?: number;
35+
first_name?: string;
36+
last_name?: string | null;
37+
timezone?: string | null;
38+
}>();
39+
40+
expect(typeof profile).toBe("object");
41+
expect(typeof profile?.id).toBe("number");
42+
expect(typeof profile?.first_name).toBe("string");
3543
},
3644
TIMEOUT_MS
3745
);

0 commit comments

Comments
 (0)