feat: initial Cutdex application
Add the Flutter video editing application with project management, media import, timeline editing, preview, AI assistance, diagnostics and settings. Include shared UI and native host packages, platform runners, application tests and release tooling. Provide usage and contribution guides, the MIT license and third-party notices. Exclude local credentials, build outputs and validation data.
This commit is contained in:
commit
27e77fff39
718 files changed
+183958
No files matched your search
@@ -0,0 +1,56 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:cutdex/integrations/agent/conversation_repository.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
void main() {
|
||||
final metadata = ConversationMetadata(
|
||||
id: 'conversation',
|
||||
projectId: 'project',
|
||||
title: 'Hello',
|
||||
createdAt: DateTime.utc(2026, 10, 1, 2),
|
||||
updatedAt: DateTime.utc(2026, 10, 1, 3),
|
||||
providerId: 'provider',
|
||||
modelId: 'model',
|
||||
timelineId: 'timeline',
|
||||
pending: false,
|
||||
responseDurationsMs: const [null, 1234],
|
||||
);
|
||||
|
||||
test('metadata persists identity, dates and missing reply durations', () {
|
||||
final restored = ConversationMetadata.fromJson(
|
||||
(jsonDecode(jsonEncode(metadata.toJson())) as Map)
|
||||
.cast<String, Object?>(),
|
||||
);
|
||||
expect(restored, metadata);
|
||||
expect(restored.copyWith(title: 'Renamed').responseDurationsMs, [
|
||||
null,
|
||||
1234,
|
||||
]);
|
||||
});
|
||||
|
||||
test('new metadata stores explicit pending state and empty durations', () {
|
||||
final encoded = metadata.copyWith(responseDurationsMs: []).toJson();
|
||||
expect(encoded['pending'], false);
|
||||
expect(encoded['responseDurationsMs'], isEmpty);
|
||||
expect(encoded.containsKey('version'), false);
|
||||
});
|
||||
|
||||
for (final field in ['pending', 'responseDurationsMs']) {
|
||||
test('stored metadata requires an explicit $field field', () {
|
||||
final json = metadata.toJson()..remove(field);
|
||||
expect(
|
||||
() => ConversationMetadata.fromJson(json),
|
||||
throwsA(isA<MissingRequiredKeysException>()),
|
||||
);
|
||||
});
|
||||
test('stored metadata rejects null $field values', () {
|
||||
final json = metadata.toJson()..[field] = null;
|
||||
expect(
|
||||
() => ConversationMetadata.fromJson(json),
|
||||
throwsA(isA<DisallowedNullValueException>()),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user