30 lines
1.0 KiB
Dart
30 lines
1.0 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:yx_icon_fonts/yx_icon_fonts.dart';
|
|
|
|
void main() {
|
|
group('YXIconFonts', () {
|
|
test('should have valid icon data', () {
|
|
// 测试图标常量是否存在且有效
|
|
expect(YXIconFonts.iconMsgContacts, isNotNull);
|
|
expect(YXIconFonts.iconMsgContacts.codePoint, isA<int>());
|
|
expect(YXIconFonts.iconMsgContacts.fontFamily, equals('iconfont'));
|
|
});
|
|
|
|
test('should create YXIcon widget', () {
|
|
// 测试 YXIcon 组件创建
|
|
final icon = YXIcon(YXIconFonts.iconMsgContacts);
|
|
expect(icon, isNotNull);
|
|
expect(icon.icon, equals(YXIconFonts.iconMsgContacts));
|
|
});
|
|
|
|
test('should have multiple icons defined', () {
|
|
// 测试多个图标常量
|
|
expect(YXIconFonts.iconMsgContacts, isNotNull);
|
|
expect(YXIconFonts.iconMsgSearch, isNotNull);
|
|
expect(YXIconFonts.icon44Edit, isNotNull);
|
|
expect(YXIconFonts.icon44Delete, isNotNull);
|
|
expect(YXIconFonts.icon44Add, isNotNull);
|
|
});
|
|
});
|
|
}
|