From 7fe0d8475262afd2b3b29738cd70e1fbaf23c7bc Mon Sep 17 00:00:00 2001 From: Jacob Persson <7156+typfel@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:46:09 +0100 Subject: [PATCH] test(web): add test for retrieving the CC version --- crypto-ffi/bindings/js/test/CoreCrypto.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crypto-ffi/bindings/js/test/CoreCrypto.test.ts b/crypto-ffi/bindings/js/test/CoreCrypto.test.ts index 7693f9f988..e88e00ce70 100644 --- a/crypto-ffi/bindings/js/test/CoreCrypto.test.ts +++ b/crypto-ffi/bindings/js/test/CoreCrypto.test.ts @@ -878,6 +878,19 @@ describe("build", () => { }); }); +describe("build", () => { + it("version can be retrieved and is a semantic version number", async () => { + await expect( + browser.execute(async () => window.ccModule.version()) + ).resolves.toMatch( + RegExp( + // Regex for matching semantic versions from https://semver.org + "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" + ) + ); + }); +}); + describe("Error type mapping", () => { it("should work for conversation already exists", async () => { await ccInit(ALICE_ID);