fix(openclaw controller): use buildOpenClawControlUiUrl for generating gateway URLs (#493)
This commit is contained in:
15
tests/unit/openclaw-control-ui.test.ts
Normal file
15
tests/unit/openclaw-control-ui.test.ts
Normal 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/');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user