Files
eryao/apps/test/shared/widgets/divination/yao_glyph_test.dart
T

31 lines
1.1 KiB
Dart
Raw Normal View History

2026-04-03 16:56:47 +08:00
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:meeyao_qianwen/features/divination/data/models/divination_params.dart';
import 'package:meeyao_qianwen/shared/widgets/divination/yao_glyph.dart';
void main() {
testWidgets('youngYang renders one solid segment', (tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(body: YaoGlyph(type: YaoType.youngYang)),
),
);
expect(find.byKey(const Key('yao_glyph_solid')), findsOneWidget);
expect(find.byKey(const Key('yao_glyph_split_left')), findsNothing);
expect(find.byKey(const Key('yao_glyph_split_right')), findsNothing);
});
testWidgets('youngYin renders two split segments', (tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(body: YaoGlyph(type: YaoType.youngYin)),
),
);
expect(find.byKey(const Key('yao_glyph_solid')), findsNothing);
expect(find.byKey(const Key('yao_glyph_split_left')), findsOneWidget);
expect(find.byKey(const Key('yao_glyph_split_right')), findsOneWidget);
});
}