Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(profile-ui): r3-l5 cover desktop link defaults

Josuécb6e5313d475
diff --git a/profile-ui/package-lock.json b/profile-ui/package-lock.json
index bfa7236b7..6a65235fd 100644
--- a/profile-ui/package-lock.json
+++ b/profile-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.160",
+ "version": "0.1.161",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-profile-ui",
- "version": "0.1.160",
+ "version": "0.1.161",
"dependencies": {
"@clerum/desktop-app-links": "file:../packages/desktop-app-links",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/profile-ui/package.json b/profile-ui/package.json
index 3fe9190b3..a0e0c1e07 100644
--- a/profile-ui/package.json
+++ b/profile-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.160",
+ "version": "0.1.161",
"private": true,
"scripts": {
"dev": "next dev",
diff --git a/profile-ui/test/desktopAppLinks.test.ts b/profile-ui/test/desktopAppLinks.test.ts
index 0e4cb29e4..3848136b9 100644
--- a/profile-ui/test/desktopAppLinks.test.ts
+++ b/profile-ui/test/desktopAppLinks.test.ts
@@ -1,12 +1,37 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {
+ buildDesktopEnvironmentLink,
buildEvenfireDesktopAppContentSecurityPolicy,
buildEvenfireDesktopAppLink,
buildEvenfireDesktopAppRedirectDocument,
navigateToDesktopApp,
} from '../lib/desktopAppLinks'
+test('buildDesktopEnvironmentLink defaults the tenant name to Evenfire', () => {
+ const link = buildDesktopEnvironmentLink({
+ externalRestApiBaseUrl: 'https://api.example.com',
+ rpcProxyBaseUrl: '',
+ appName: '',
+ })
+
+ assert.ok(link)
+ const parsedLink = new URL(link)
+ assert.equal(parsedLink.searchParams.get('tenantName'), 'Evenfire')
+})
+
+test('buildDesktopEnvironmentLink omits an empty RPC proxy URL', () => {
+ const link = buildDesktopEnvironmentLink({
+ externalRestApiBaseUrl: 'https://api.example.com',
+ rpcProxyBaseUrl: '',
+ appName: 'Example tenant',
+ })
+
+ assert.ok(link)
+ const parsedLink = new URL(link)
+ assert.equal(parsedLink.searchParams.get('rpcProxyBaseUrl'), null)
+})
+
test('navigateToDesktopApp assigns the protocol URL to the browser location', () => {
const location = { href: 'https://profile.example.com/settings' }
const desktopHref =