shuffle the running-verb order per turn (T-255)

Each RunningIndicator shuffles a copy of the verb list on creation, so a turn
doesn't always start with the same word. A `shuffle` flag (default true) is
turned off in tests for deterministic assertions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 11:08:51 +02:00
co-authored by Claude Opus 4.8
parent 3af5ddcbf1
commit 9905854fca
2 changed files with 20 additions and 4 deletions
@@ -23,7 +23,7 @@ void main() {
Widget wrap({bool reducedMotion = false}) => MediaQuery(
data: MediaQueryData(disableAnimations: reducedMotion),
child: const RunningIndicator(),
child: const RunningIndicator(shuffle: false),
);
testWidgets('animates the ellipsis and rotates the verb', (tester) async {
@@ -51,4 +51,12 @@ void main() {
await tester.pump(const Duration(seconds: 6));
expect(_text(tester), 'Pondering…'); // unchanged — no animation running
});
testWidgets('shuffle:true renders a verb from the list', (tester) async {
await tester.pumpWidget(harness(f, const MediaQuery(data: MediaQueryData(), child: RunningIndicator(shuffle: true))));
await tester.pump();
final word = _text(tester)!.replaceAll('.', '');
expect(runningVerbs.contains(word), isTrue);
await tester.pumpWidget(harness(f, const SizedBox())); // dispose the animation
});
}