修正原生壳公开主站配置
将原生壳公开主站统一为 www.genarrative.world 调整 Tauri release 直接加载线上主站并移除 frontendDist 打包 补齐创作入口配置开发代理与回归测试 同步原生壳方案文档和共享记忆
This commit is contained in:
@@ -120,7 +120,7 @@ describe('PlatformProfileQrScannerModal', () => {
|
||||
const getUserMedia = vi.fn();
|
||||
const onResult = vi.fn();
|
||||
vi.spyOn(hostBridgeServices, 'scanHostQrCode').mockResolvedValue({
|
||||
value: 'https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
value: 'https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
format: 'qr_code',
|
||||
});
|
||||
installMediaDevices(getUserMedia);
|
||||
@@ -140,7 +140,7 @@ describe('PlatformProfileQrScannerModal', () => {
|
||||
});
|
||||
|
||||
expect(onResult).toHaveBeenCalledWith(
|
||||
'https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
'https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
);
|
||||
expect(getUserMedia).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -3181,7 +3181,7 @@ test('profile scan action uses native QR scanner before browser camera', async (
|
||||
const scanHostQrCodeSpy = vi
|
||||
.spyOn(hostBridgeServices, 'scanHostQrCode')
|
||||
.mockResolvedValue({
|
||||
value: 'https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
value: 'https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
format: 'qr_code',
|
||||
});
|
||||
|
||||
@@ -3203,7 +3203,7 @@ test('profile scan action uses native QR scanner before browser camera', async (
|
||||
|
||||
expect(scanHostQrCodeSpy).toHaveBeenCalledTimes(1);
|
||||
expect(qrScannerDialog.textContent).toContain(
|
||||
'已识别:https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
'已识别:https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
);
|
||||
expect(getUserMedia).not.toHaveBeenCalled();
|
||||
expect(mockGetRpgProfileRechargeCenter).not.toHaveBeenCalled();
|
||||
|
||||
@@ -22,6 +22,24 @@ describe('vite dev api proxy', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('forwards the public creation entry config route to the Rust API server', async () => {
|
||||
const resolvedConfig =
|
||||
typeof viteConfig === 'function'
|
||||
? await viteConfig({ command: 'serve', mode: 'test' })
|
||||
: viteConfig;
|
||||
|
||||
// 中文注释:创作入口配置是底部加号入口的首屏事实源,漏配代理会回退 index.html。
|
||||
expect(resolvedConfig.server?.proxy).toEqual(
|
||||
expect.objectContaining({
|
||||
'/api/creation-entry': expect.objectContaining({
|
||||
target: expect.any(String),
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('forwards the admin route to the admin dev server', async () => {
|
||||
const resolvedConfig =
|
||||
typeof viteConfig === 'function'
|
||||
|
||||
@@ -1139,7 +1139,7 @@ describe('hostBridge', () => {
|
||||
}
|
||||
: request.method === 'scanner.scanQrCode'
|
||||
? {
|
||||
value: ' https://app.genarrative.world/works/detail?work=PZ-1 ',
|
||||
value: ' https://www.genarrative.world/works/detail?work=PZ-1 ',
|
||||
format: 'qr_code',
|
||||
}
|
||||
: request.method === 'file.importImage'
|
||||
@@ -1246,7 +1246,7 @@ describe('hostBridge', () => {
|
||||
openHostShare({
|
||||
title: '暖灯猫街',
|
||||
message: '邀请你来玩',
|
||||
url: 'https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
url: 'https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
}),
|
||||
).resolves.toBe(true);
|
||||
await expect(
|
||||
@@ -1277,7 +1277,7 @@ describe('hostBridge', () => {
|
||||
bytes: 6,
|
||||
});
|
||||
await expect(scanHostQrCode()).resolves.toEqual({
|
||||
value: 'https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
value: 'https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
format: 'qr_code',
|
||||
});
|
||||
await expect(importHostTextFile()).resolves.toEqual({
|
||||
@@ -1410,7 +1410,7 @@ describe('hostBridge', () => {
|
||||
payload: {
|
||||
title: '暖灯猫街',
|
||||
message: '邀请你来玩',
|
||||
url: 'https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
url: 'https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
},
|
||||
}),
|
||||
});
|
||||
@@ -1505,13 +1505,13 @@ describe('hostBridge', () => {
|
||||
navigateHostNativePage('javascript:alert(1)'),
|
||||
).resolves.toBe(false);
|
||||
await expect(
|
||||
navigateHostNativePage('https://app.genarrative.world/\nnext'),
|
||||
navigateHostNativePage('https://www.genarrative.world/\nnext'),
|
||||
).resolves.toBe(false);
|
||||
expect(invoke).not.toHaveBeenCalled();
|
||||
|
||||
await expect(
|
||||
navigateHostNativePage(
|
||||
'https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
'https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
),
|
||||
).resolves.toBe(true);
|
||||
await expect(
|
||||
@@ -1522,7 +1522,7 @@ describe('hostBridge', () => {
|
||||
request: expect.objectContaining({
|
||||
method: 'navigation.openNativePage',
|
||||
payload: {
|
||||
url: 'https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
url: 'https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
},
|
||||
}),
|
||||
});
|
||||
@@ -1705,7 +1705,7 @@ describe('hostBridge', () => {
|
||||
openHostShare({
|
||||
title: '暖灯猫街',
|
||||
message: '邀请你来玩',
|
||||
url: 'https://app.genarrative.world/works/detail?work=PZ-1',
|
||||
url: 'https://www.genarrative.world/works/detail?work=PZ-1',
|
||||
}),
|
||||
).resolves.toBe(false);
|
||||
await expect(
|
||||
|
||||
Reference in New Issue
Block a user