mirror of
https://github.com/block/buzz.git
synced 2026-10-27 04:30:52 +00:00
## Summary - replace the mobile composer sheet with a compact expanding capsule - add vertically stacked attachment actions and an inline camera preview - align suggestion, formatting, and send treatments with desktop ## Validation - `just mobile-check` - `just mobile-test` (541 passed, 1 skipped) --------- Signed-off-by: npub102wg7q285p64ch2fjvstmf2ntn2sz3c4u5hmwatalc76mhsuauysftjtfj <7a9c8f0147a0755c5d499320bda5535cd5014715e52fb7757dfe3dadde1cef09@buzz.block.builderlab.xyz> Co-authored-by: npub102wg7q285p64ch2fjvstmf2ntn2sz3c4u5hmwatalc76mhsuauysftjtfj <7a9c8f0147a0755c5d499320bda5535cd5014715e52fb7757dfe3dadde1cef09@buzz.block.builderlab.xyz>
36 lines
1013 B
Dart
36 lines
1013 B
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:image_picker/image_picker.dart';
|
|
import 'package:buzz/features/channels/camera_capture_cleanup.dart';
|
|
|
|
void main() {
|
|
test('deletes the inline camera file after upload succeeds', () async {
|
|
final file = File(
|
|
'${Directory.systemTemp.path}/buzz-camera-${DateTime.now().microsecondsSinceEpoch}.jpg',
|
|
);
|
|
await file.writeAsBytes([1, 2, 3]);
|
|
|
|
await processCapturedImage(XFile(file.path), (_) async {});
|
|
|
|
expect(await file.exists(), isFalse);
|
|
});
|
|
|
|
test('deletes the inline camera file when upload fails', () async {
|
|
final file = File(
|
|
'${Directory.systemTemp.path}/buzz-camera-${DateTime.now().microsecondsSinceEpoch}.jpg',
|
|
);
|
|
await file.writeAsBytes([1, 2, 3]);
|
|
|
|
await expectLater(
|
|
processCapturedImage(
|
|
XFile(file.path),
|
|
(_) async => throw Exception('upload failed'),
|
|
),
|
|
throwsException,
|
|
);
|
|
|
|
expect(await file.exists(), isFalse);
|
|
});
|
|
}
|