Skip to content

Commit

Permalink
fix: image action behavior in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Dec 9, 2024
1 parent 6c2cb47 commit 83fe121
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/backend/server/src/plugins/copilot/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class CopilotStorage {
) {
const name = `${userId}/${workspaceId}/${key}`;
await this.provider.put(name, blob);
if (this.config.node.dev) {
if (this.config.node.dev || this.config.node.test) {
// return image base64url for dev environment
return `data:image/png;base64,${blob.toString('base64')}`;
}
Expand Down
7 changes: 3 additions & 4 deletions tests/affine-cloud-copilot/e2e/copilot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,14 @@ test.describe('chat with block', () => {
.then(b => b.click());
});

// TODO(@darkskygit): not work on ci
test.skip('explain this image', async ({ page }) => {
test('explain this image', async ({ page }) => {
await page
.waitForSelector('.ai-item-explain-this-image')
.then(i => i.click());
expect(await collectTextAnswer(page)).toBeTruthy();
});
// TODO(@darkskygit): not work on ci
test.skip('generate a caption', async ({ page }) => {

test('generate a caption', async ({ page }) => {
await page
.waitForSelector('.ai-item-generate-a-caption')
.then(i => i.click());
Expand Down

0 comments on commit 83fe121

Please sign in to comment.