Skip to content

Commit

Permalink
✅ add basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
LeGoffMael committed Nov 20, 2023
1 parent 30ee3d8 commit c473da9
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/insta_assets_picker_test.dart
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
void main() {}
import 'package:flutter_test/flutter_test.dart';
import 'package:insta_assets_picker/insta_assets_picker.dart';
import 'package:insta_assets_picker/src/insta_assets_crop_controller.dart';

void main() {
test('Ensure nextCropRatio() loop', () {
final InstaAssetsCropController controller =
InstaAssetsCropController(false, const InstaAssetCropDelegate());

expect(controller.aspectRatio, 1);
expect(controller.aspectRatioString, '1:1');

controller.nextCropRatio();

expect(controller.aspectRatio, 4 / 5);
expect(controller.aspectRatioString, '4:5');

controller.nextCropRatio();

expect(controller.aspectRatio, 1);
expect(controller.aspectRatioString, '1:1');
});
}

0 comments on commit c473da9

Please sign in to comment.