fix(meditate): Explore puts what is made for a goal first

Calm down and Focus share their first two practices, so choosing between
them seemed to change nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-05 15:44:40 +01:00
commit 1fa5890f8e
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -0,0 +1,26 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:halkyon_meditate_flutter/src/feature/practice/model/practice.dart';
void main() {
test('every goal starts with what is made for it, so that choosing one '
"shows (the developer's review, 5 Nov 2026)", () {
final firsts = [for (final goal in Goal.values) practicesFor(goal).first];
expect(firsts.toSet().length, greaterThan(1));
expect(
practicesFor(Goal.calm).first,
isNot(practicesFor(Goal.focus).first),
);
expect(practicesFor(Goal.focus).first.goals, {Goal.focus});
});
test('a goal keeps every practice serving it; none chosen, all as they '
'are', () {
for (final goal in Goal.values) {
expect(
practicesFor(goal).toSet(),
practices.where((practice) => practice.goals.contains(goal)).toSet(),
);
}
expect(practicesFor(null), practices);
});
}