42 lines
1.1 KiB
Dart
42 lines
1.1 KiB
Dart
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);
|
||
});
|
||
}
|