8081d98c67
Initial public release. Anonymous on-device identity (no phone number, e-mail, or password), Signal-protocol cryptography (X3DH + PQXDH, Double Ratchet, sealed sender) via libsignal, a metadata-minimizing relay, group chats, disappearing messages, encrypted local storage, optional Tor transport, and a UI localized into Czech, English, German, Russian, and Italian. Monorepo: Flutter client (app/), Rust relay + wire types (rust/), protobuf definitions (proto/), self-host deploy (deploy/). Licensed under AGPL-3.0 with an app-store distribution exception (§7).
36 lines
1.3 KiB
Dart
36 lines
1.3 KiB
Dart
import 'dart:convert';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:sepot/models/message.dart';
|
|
|
|
void main() {
|
|
test('reakce/edit/delete přežijí JSON roundtrip', () {
|
|
final m = Message.text(senderId: 'me', recipientId: 'you', content: 'ahoj')
|
|
.copyWith(
|
|
reactions: {'FP1': '👍', 'FP2': '❤️'},
|
|
editedAt: DateTime.parse('2026-07-06T20:00:00.000'),
|
|
);
|
|
final back =
|
|
Message.fromJson(jsonDecode(jsonEncode(m.toJson())) as Map<String, dynamic>);
|
|
expect(back.reactions, {'FP1': '👍', 'FP2': '❤️'});
|
|
expect(back.editedAt, isNotNull);
|
|
expect(back.isDeleted, isFalse);
|
|
});
|
|
|
|
test('smazaná zpráva: isDeleted + prázdný obsah', () {
|
|
final m = Message.text(senderId: 'me', recipientId: 'you', content: 'x')
|
|
.copyWith(isDeleted: true, content: '', reactions: const {});
|
|
final back =
|
|
Message.fromJson(jsonDecode(jsonEncode(m.toJson())) as Map<String, dynamic>);
|
|
expect(back.isDeleted, isTrue);
|
|
expect(back.content, '');
|
|
});
|
|
|
|
test('reply nese replyToId', () {
|
|
final m = Message.text(
|
|
senderId: 'me', recipientId: 'you', content: 'odpoved', replyToId: 'abc');
|
|
final back =
|
|
Message.fromJson(jsonDecode(jsonEncode(m.toJson())) as Map<String, dynamic>);
|
|
expect(back.replyToId, 'abc');
|
|
});
|
|
}
|