feat: integrate learning module
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user