test: object tests

This commit is contained in:
Enzo Lizama 2022-10-04 17:59:30 -05:00
parent 7914949613
commit 50ebaa3ab8

View File

@ -0,0 +1,20 @@
import 'dart:io';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:appflowy_editor/src/extensions/object_extensions.dart';
void main() {
group('FlowyObjectExtensions::', () {
test('unwrapOrNull', () {
final result = const TextSpan().unwrapOrNull<HitTestTarget>();
assert(result is TextSpan);
});
test('unwrapOrNull - return null', () {
final result = const TextSpan().unwrapOrNull<ServerSocket>();
expect(result, null);
});
});
}