[PR #7660] [MERGED] Ai writer test #8029

Closed
opened 2026-03-23 23:22:17 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7660
Author: @appflowy
Created: 3/31/2025
Status: Merged
Merged: 4/25/2025
Merged by: @appflowy

Base: mainHead: ai_writer_test


📝 Commits (10+)

  • 89647ae chore: logs for windows
  • 72fe1d7 chore: add integration test
  • 5c99572 chore: rename test
  • 73e3cbd chore: remove env test
  • 2ec68c9 chore: merge remote-tracking branch 'upstream/main' into this one
  • 01dbcf7 chore: don't try to force update selection
  • e4187a5 Merge branch 'main' into ai_writer_test
  • 0d0c6ff chore: update test
  • 13d8b1e chore: fix test
  • 6da7c17 chore: upgrade cloud version

📊 Changes

15 files changed (+486 additions, -71 deletions)

View changed files

📝 .github/workflows/flutter_ci.yaml (+11 -11)
📝 frontend/appflowy_flutter/integration_test/desktop/cloud/cloud_runner.dart (+2 -2)
📝 frontend/appflowy_flutter/integration_test/desktop/cloud/document/document_ai_writer_test.dart (+187 -0)
📝 frontend/appflowy_flutter/integration_test/desktop/cloud/set_env.dart (+4 -2)
frontend/appflowy_flutter/integration_test/shared/ai_test_op.dart (+41 -0)
📝 frontend/appflowy_flutter/integration_test/shared/base.dart (+82 -43)
frontend/appflowy_flutter/integration_test/shared/mock/mock_ai.dart (+128 -0)
📝 frontend/appflowy_flutter/lib/ai/service/appflowy_ai_service.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/env/cloud_env.dart (+6 -1)
📝 frontend/appflowy_flutter/lib/mobile/presentation/setting/self_host/self_host_bottom_sheet.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/operations/ai_writer_cubit.dart (+5 -3)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/widgets/ai_writer_scroll_wrapper.dart (+1 -0)
📝 frontend/appflowy_flutter/lib/startup/deps_resolver.dart (+2 -0)
📝 frontend/appflowy_flutter/lib/workspace/application/settings/appflowy_cloud_urls_bloc.dart (+1 -1)
📝 frontend/appflowy_flutter/test/bloc_test/ai_writer_test/ai_writer_bloc_test.dart (+14 -6)

📄 Description

Feature Preview


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Enhance AI writer testing infrastructure by adding mock AI repository and improving test coverage for AI-related features in the document editor

New Features:

  • Introduce MockAIRepository for simulating AI responses
  • Add integration test for AI-powered document editing features

Enhancements:

  • Refactor AI service dependency injection to use GetIt
  • Improve error handling and logging in AI writer cubit
  • Add support for mocking AI responses in different test scenarios

Tests:

  • Add comprehensive test cases for AI writer functionality
  • Implement mock AI repository for consistent and predictable AI responses in tests
  • Create integration tests for AI writing improvements, grammar fixes, and user questions

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/7660 **Author:** [@appflowy](https://github.com/appflowy) **Created:** 3/31/2025 **Status:** ✅ Merged **Merged:** 4/25/2025 **Merged by:** [@appflowy](https://github.com/appflowy) **Base:** `main` ← **Head:** `ai_writer_test` --- ### 📝 Commits (10+) - [`89647ae`](https://github.com/AppFlowy-IO/AppFlowy/commit/89647ae68305f5c7d08403ec6598e53b882617a9) chore: logs for windows - [`72fe1d7`](https://github.com/AppFlowy-IO/AppFlowy/commit/72fe1d7c471e5d069fd16156f20cf07512e6bd6d) chore: add integration test - [`5c99572`](https://github.com/AppFlowy-IO/AppFlowy/commit/5c99572e9304f8322157f3962cea22bd7b6a41ff) chore: rename test - [`73e3cbd`](https://github.com/AppFlowy-IO/AppFlowy/commit/73e3cbdc185959fa5d685ed2ca3fc3f555954746) chore: remove env test - [`2ec68c9`](https://github.com/AppFlowy-IO/AppFlowy/commit/2ec68c926958314a3a422a325f0e785859aa1d01) chore: merge remote-tracking branch 'upstream/main' into this one - [`01dbcf7`](https://github.com/AppFlowy-IO/AppFlowy/commit/01dbcf7697e87e14614d12d99715b5a2332aaa99) chore: don't try to force update selection - [`e4187a5`](https://github.com/AppFlowy-IO/AppFlowy/commit/e4187a570c4e3942db0ad6bb4a761d0c7cc5714e) Merge branch 'main' into ai_writer_test - [`0d0c6ff`](https://github.com/AppFlowy-IO/AppFlowy/commit/0d0c6fff32a364a08152c280283c6b44f77b27ee) chore: update test - [`13d8b1e`](https://github.com/AppFlowy-IO/AppFlowy/commit/13d8b1ed37405abf86259ef52ebf7e9b32ef0717) chore: fix test - [`6da7c17`](https://github.com/AppFlowy-IO/AppFlowy/commit/6da7c17a9ef3aba8b0b60866bd4d129d3116d117) chore: upgrade cloud version ### 📊 Changes **15 files changed** (+486 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/flutter_ci.yaml` (+11 -11) 📝 `frontend/appflowy_flutter/integration_test/desktop/cloud/cloud_runner.dart` (+2 -2) 📝 `frontend/appflowy_flutter/integration_test/desktop/cloud/document/document_ai_writer_test.dart` (+187 -0) 📝 `frontend/appflowy_flutter/integration_test/desktop/cloud/set_env.dart` (+4 -2) ➕ `frontend/appflowy_flutter/integration_test/shared/ai_test_op.dart` (+41 -0) 📝 `frontend/appflowy_flutter/integration_test/shared/base.dart` (+82 -43) ➕ `frontend/appflowy_flutter/integration_test/shared/mock/mock_ai.dart` (+128 -0) 📝 `frontend/appflowy_flutter/lib/ai/service/appflowy_ai_service.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/env/cloud_env.dart` (+6 -1) 📝 `frontend/appflowy_flutter/lib/mobile/presentation/setting/self_host/self_host_bottom_sheet.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/operations/ai_writer_cubit.dart` (+5 -3) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/widgets/ai_writer_scroll_wrapper.dart` (+1 -0) 📝 `frontend/appflowy_flutter/lib/startup/deps_resolver.dart` (+2 -0) 📝 `frontend/appflowy_flutter/lib/workspace/application/settings/appflowy_cloud_urls_bloc.dart` (+1 -1) 📝 `frontend/appflowy_flutter/test/bloc_test/ai_writer_test/ai_writer_bloc_test.dart` (+14 -6) </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [ ] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [ ] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. ## Summary by Sourcery Enhance AI writer testing infrastructure by adding mock AI repository and improving test coverage for AI-related features in the document editor New Features: - Introduce MockAIRepository for simulating AI responses - Add integration test for AI-powered document editing features Enhancements: - Refactor AI service dependency injection to use GetIt - Improve error handling and logging in AI writer cubit - Add support for mocking AI responses in different test scenarios Tests: - Add comprehensive test cases for AI writer functionality - Implement mock AI repository for consistent and predictable AI responses in tests - Create integration tests for AI writing improvements, grammar fixes, and user questions --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:22:17 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8029
No description provided.