Move editor UI into the app and release verified Core dependencies (#14)
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
This commit was merged in pull request #14.
This commit is contained in:
1 parent
abc1868550
commit
06f1c26681
452 files changed
+43806
-2329
No files matched your search
@@ -12,6 +12,39 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'support/memory_app_settings.dart';
|
||||
|
||||
void main() {
|
||||
test(
|
||||
'MCP persists its initial token once and skips unchanged updates',
|
||||
() async {
|
||||
final repository = _CountingMcpRepository();
|
||||
final container = ProviderContainer.test(
|
||||
overrides: [
|
||||
mcpSettingsRepositoryProvider.overrideWithValue(repository),
|
||||
],
|
||||
);
|
||||
final initial = await container.read(mcpSettingsProvider.future);
|
||||
expect(repository.writes, hasLength(1));
|
||||
final controller = container.read(mcpSettingsProvider.notifier);
|
||||
await controller.saveSettings(
|
||||
enabled: initial.enabled,
|
||||
port: initial.port,
|
||||
);
|
||||
await Future.wait(
|
||||
List.generate(5, (_) => controller.saveSettings(enabled: true)),
|
||||
);
|
||||
expect(repository.writes, hasLength(2));
|
||||
expect(repository.value!.token, initial.token);
|
||||
repository.failWrites = true;
|
||||
await expectLater(
|
||||
controller.saveSettings(enabled: false),
|
||||
throwsStateError,
|
||||
);
|
||||
repository.failWrites = false;
|
||||
await controller.saveSettings(enabled: false);
|
||||
expect(repository.writes, hasLength(4));
|
||||
expect(repository.value!.enabled, false);
|
||||
},
|
||||
);
|
||||
|
||||
test('overlapping MCP updates retain enablement and port', () async {
|
||||
final repository = MemoryMcpSettingsRepository();
|
||||
final container = ProviderContainer(
|
||||
@@ -182,3 +215,13 @@ void main() {
|
||||
expect(find.text('已停用'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
|
||||
class _CountingMcpRepository extends MemoryMcpSettingsRepository {
|
||||
final writes = <McpSettingsValue>[];
|
||||
|
||||
@override
|
||||
Future<void> save(McpSettingsValue configuration) {
|
||||
writes.add(configuration);
|
||||
return super.save(configuration);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user