mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 04:47:03 -06:00
test: check device identity pem blocks
This commit is contained in:
@@ -94,8 +94,14 @@ describe("device identity crypto helpers", () => {
|
||||
).toBe(true);
|
||||
expect(stored.version).toBe(1);
|
||||
expect(stored.deviceId).toBe(SWIFT_RAW_DEVICE_ID);
|
||||
expect(stored.publicKeyPem).toEqual(expect.stringContaining("BEGIN PUBLIC KEY"));
|
||||
expect(stored.privateKeyPem).toEqual(expect.stringContaining("BEGIN PRIVATE KEY"));
|
||||
expect(typeof stored.publicKeyPem).toBe("string");
|
||||
expect(typeof stored.privateKeyPem).toBe("string");
|
||||
const publicKeyPem = stored.publicKeyPem as string;
|
||||
const privateKeyPem = stored.privateKeyPem as string;
|
||||
expect(publicKeyPem.startsWith("-----BEGIN PUBLIC KEY-----\n")).toBe(true);
|
||||
expect(publicKeyPem.endsWith("-----END PUBLIC KEY-----\n")).toBe(true);
|
||||
expect(privateKeyPem.startsWith("-----BEGIN PRIVATE KEY-----\n")).toBe(true);
|
||||
expect(privateKeyPem.endsWith("-----END PRIVATE KEY-----\n")).toBe(true);
|
||||
expect(stored.createdAtMs).toBe(1_700_000_000_000);
|
||||
expect(stored).not.toHaveProperty("publicKey");
|
||||
expect(stored).not.toHaveProperty("privateKey");
|
||||
|
||||
Reference in New Issue
Block a user