Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/view/analysis/analysis_board.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class AnalysisBoardState extends ConsumerState<AnalysisBoard> {
: null;
final bestMoves = pickBestMoves(localBestMoves: localBestMoves, savedEval: currentNode.eval);
final ISet<Shape> bestMoveShapes =
bestMoves != null
bestMoves != null && showBestMoveArrow
? computeBestMoveShapes(
bestMoves,
currentNode.position.turn,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ packages:
dependency: "direct main"
description:
name: chessground
sha256: b5b5d329c116fdaa545de3e7e64111e1cd7a3f9813d257469b2eaa310bd157dd
sha256: "5ee24bf66674d45021d8ab5c2df0b6dc1e4072c61bea2148ac2e2c38fe2bb0dd"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
version: "7.1.0"
ci:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
async: ^2.10.0
auto_size_text: ^3.0.0
cached_network_image: ^3.2.2
chessground: ^7.0.0
chessground: ^7.1.0
clock: ^1.1.1
collection: ^1.17.0
connectivity_plus: ^6.0.2
Expand Down
12 changes: 12 additions & 0 deletions test/view/analysis/analysis_screen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,18 @@ void main() {
await tester.pump(kStartLocalEngineDebounceDelay + kEngineEvalEmissionThrottleDelay);
expect(find.widgetWithText(InlineMove, '+0.2'), findsNWidgets(2));
});

testWidgets('best move arrow is shown if enabled', (tester) async {
await makeEngineTestApp(tester);
await tester.pump(kStartLocalEngineDebounceDelay);
expect(find.byType(BoardShapeWidget), findsOneWidget);
});

testWidgets('best move arrow is not shown if disabled', (tester) async {
await makeEngineTestApp(tester, showBestMoveArrow: false);
await tester.pump(kStartLocalEngineDebounceDelay);
expect(find.byType(BoardShapeWidget), findsNothing);
});
});
}

Expand Down
8 changes: 7 additions & 1 deletion test/view/engine/test_engine_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Future<void> makeEngineTestApp(
bool isComputerAnalysisEnabled = true,
bool isEngineEnabled = true,
bool isCloudEvalEnabled = true,
bool showBestMoveArrow = true,
Duration connectionLag = Duration.zero,
}) async {
final fakeChannel = FakeWebSocketChannel(
Expand Down Expand Up @@ -59,7 +60,12 @@ Future<void> makeEngineTestApp(
.toJson(),
),
PrefCategory.analysis.storageKey: jsonEncode(
AnalysisPrefs.defaults.copyWith(enableComputerAnalysis: isComputerAnalysisEnabled).toJson(),
AnalysisPrefs.defaults
.copyWith(
enableComputerAnalysis: isComputerAnalysisEnabled,
showBestMoveArrow: showBestMoveArrow,
)
.toJson(),
),
},
overrides: [
Expand Down