Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s
44 lines
1.7 KiB
Dart
44 lines
1.7 KiB
Dart
import 'package:cutdex/features/assistant/agent_composer_controller.dart';
|
|
import 'package:cutdex/features/assistant/agent_composer_store.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
late AgentComposerStore store;
|
|
setUp(() {
|
|
store = AgentComposerStore(
|
|
createComposer: (_) => AgentComposerController(
|
|
canImport: () => false,
|
|
pickFiles: () async => [],
|
|
importMedia: (_) async => null,
|
|
),
|
|
);
|
|
});
|
|
tearDown(() => store.dispose());
|
|
|
|
test('the initial unassigned draft follows only the first project', () {
|
|
final initial = store.input(null, null, projectScoped: true)
|
|
..text = 'Create a travel film';
|
|
expect(store.input('a', null, projectScoped: true), same(initial));
|
|
expect(store.input('b', null, projectScoped: true).text, isEmpty);
|
|
expect(
|
|
store.input('a', null, projectScoped: true).text,
|
|
'Create a travel film',
|
|
);
|
|
expect(store.draft.text, isEmpty);
|
|
});
|
|
|
|
test('creating a conversation keeps follow-up input in its project', () {
|
|
final first = store.input('a', null, projectScoped: true)
|
|
..text = 'Follow-up while the first reply streams';
|
|
final second = store.input('b', null, projectScoped: true)
|
|
..text = 'Another project draft';
|
|
final attachments = store.composer('a', 'draft-a');
|
|
store.promoteDraft('a', 'draft-a', 'chat-a');
|
|
expect(store.input('a', 'chat-a'), same(first));
|
|
expect(store.composer('a', 'chat-a'), same(attachments));
|
|
expect(store.input('a', null, projectScoped: true).text, isEmpty);
|
|
expect(store.input('b', null, projectScoped: true), same(second));
|
|
expect(second.text, 'Another project draft');
|
|
});
|
|
}
|