fix(openclaw controller): use buildOpenClawControlUiUrl for generating gateway URLs (#493)

This commit is contained in:
Haze
2026-03-14 18:57:43 +08:00
committed by GitHub
Unverified
parent 61291ff83f
commit 315ff6b9de
5 changed files with 38 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
import { describe, expect, it } from 'vitest';
import { buildOpenClawControlUiUrl } from '@electron/utils/openclaw-control-ui';
describe('buildOpenClawControlUiUrl', () => {
it('uses the URL fragment for one-time token bootstrap', () => {
expect(buildOpenClawControlUiUrl(18789, 'clawx-test-token')).toBe(
'http://127.0.0.1:18789/#token=clawx-test-token',
);
});
it('omits the fragment when the token is blank', () => {
expect(buildOpenClawControlUiUrl(18789, ' ')).toBe('http://127.0.0.1:18789/');
});
});