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

42 lines
1.1 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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_line_row.dart';
void main() {
testWidgets('oldYang shows circle mark when enabled', (tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: YaoLineRow(
name: '初爻',
type: YaoType.oldYang,
showChangeMark: true,
),
),
),
);
expect(find.text('初爻'), findsOneWidget);
expect(find.text(''), findsOneWidget);
});
testWidgets('oldYin does not show mark when showChangeMark=false', (
tester,
) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: YaoLineRow(
name: '二爻',
type: YaoType.oldYin,
showChangeMark: false,
),
),
),
);
expect(find.text('×'), findsNothing);
});
}