feat: integrate learning module
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-08-16 20:52:16 +08:00
parent 26b52d76e3
commit 01bee3188b
107 changed files with 6318 additions and 12063 deletions

View File

@@ -401,6 +401,35 @@ describe('works square client', () => {
});
});
it('forwards the project cover as part of the source publish request', async () => {
hostApiFetchMock.mockResolvedValueOnce({
success: true,
package: {},
upload: { version_id: 'version-1', review_status: 'building' },
});
const cover = {
fileName: 'cover.webp',
mimeType: 'image/webp',
dataBase64: 'Y292ZXI=',
};
await publishWorksProjectSource({
projectId: 'project-1',
project: {
app_id: 'space-cleaner',
title: '太空清洁队',
summary: '收集漂浮垃圾的小游戏。',
creator_name: '小明',
creator_age: 12,
},
cover,
});
const requestBody = JSON.parse(String(hostApiFetchMock.mock.calls[0]?.[1]?.body));
expect(requestBody.cover).toEqual(cover);
expect(requestBody.project.creator_age).toBe(12);
});
it('loads uploaded versions with the current access token', async () => {
hostApiFetchMock.mockResolvedValueOnce({
success: true,