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:
parent
2535da15de
commit
1fa5890f8e
1 changed files with 39 additions and 3 deletions
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue