appflowy-editor/test/infra/flowy_svg_test.dart
Ali Hassan 865195f8c6
feat : allow developer to change toolbar color as well as option to show default toolbar items and html to document converter added (#58)
* change toolbar and added export so developer can modify according to its need

* revert some chages from examples

* html to document convertion added

* test added

* code formated

* node to html added image parameter

* toolbar color and elevation added in editor stylee

* code formated

* remove duplicated exports

* fix test improts and formating
2023-04-14 10:10:03 +08:00

42 lines
1.2 KiB
Dart

import 'package:appflowy_editor/src/infra/flowy_svg.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutter_test/flutter_test.dart';
import '../test_helper.dart';
void main() {
group('FlowySvg tests', () {
testWidgets('FlowySvg w/ Name', (tester) async {
await tester.buildAndPump(
const FlowySvg(name: 'checkmark', color: Colors.blue),
);
final svgFinder = find.byType(SvgPicture);
expect(svgFinder, findsOneWidget);
final svgPicture = tester.widget<SvgPicture>(svgFinder);
expect(svgPicture.fit, BoxFit.fill);
expect(
svgPicture.colorFilter,
const ColorFilter.mode(Colors.blue, BlendMode.srcIn),
);
});
testWidgets('FlowySvg w/ Number', (tester) async {
await tester.buildAndPump(
const FlowySvg(number: 1),
);
expect(find.byType(SvgPicture), findsOneWidget);
});
testWidgets('FlowySvg null', (tester) async {
await tester.buildAndPump(
const FlowySvg(),
);
expect(find.byType(Container), findsOneWidget);
expect(find.byType(SvgPicture), findsNothing);
});
});
}