feat: unified 1..9 words session narrative, dice input before reveal, dedicated results screen, and clean session history grouping
This commit is contained in:
@@ -35,7 +35,6 @@ void main() {
|
||||
|
||||
test('Reshuffling changes the order / mapping of words to session numbers', () {
|
||||
repo.reshuffleSessionNumbers();
|
||||
// Verify total count is still 1000 and all numbers 0..999 are present
|
||||
expect(repo.totalWords, equals(1000));
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
expect(repo.getWordBySessionNumber(i)?.sessionNumber, equals(i));
|
||||
@@ -63,33 +62,53 @@ void main() {
|
||||
expect(repo.getPreviousWord(0).sessionNumber, equals(999));
|
||||
});
|
||||
|
||||
test('History entries can be added, updated with AI interpretation, and cleared', () async {
|
||||
test('Multi-word session history can be saved, updated with AI interpretation, and cleared', () async {
|
||||
await repo.clearHistory();
|
||||
expect(repo.history.isEmpty, isTrue);
|
||||
expect(repo.sessions.isEmpty, isTrue);
|
||||
|
||||
final entry = HistoryEntry(
|
||||
id: 'hist_1',
|
||||
final session = OracleSession(
|
||||
id: 'session_1',
|
||||
timestamp: DateTime(2026, 8, 31, 12, 0),
|
||||
word: 'огонь',
|
||||
sessionNumber: 777,
|
||||
partOfSpeech: 'существительное',
|
||||
symbolicMeaning: 'Очищающее пламя трансформации',
|
||||
readingType: 'Жребий момента',
|
||||
question: 'В чем суть текущего вызова?',
|
||||
question: 'В чем скрытый конфликт?',
|
||||
wordsCount: 3,
|
||||
words: [
|
||||
const SessionWord(
|
||||
word: 'огонь',
|
||||
sessionNumber: 777,
|
||||
partOfSpeech: 'существительное',
|
||||
category: 'Образ',
|
||||
symbolicMeaning: 'Очищающее пламя',
|
||||
),
|
||||
const SessionWord(
|
||||
word: 'вода',
|
||||
sessionNumber: 15,
|
||||
partOfSpeech: 'существительное',
|
||||
category: 'Образ',
|
||||
symbolicMeaning: 'Поток интуиции',
|
||||
),
|
||||
const SessionWord(
|
||||
word: 'мир',
|
||||
sessionNumber: 999,
|
||||
partOfSpeech: 'существительное',
|
||||
category: 'Образ',
|
||||
symbolicMeaning: 'Гармония согласия',
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
await repo.addHistoryEntry(entry);
|
||||
expect(repo.history.length, equals(1));
|
||||
expect(repo.history.first.word, equals('огонь'));
|
||||
expect(repo.history.first.question, equals('В чем суть текущего вызова?'));
|
||||
expect(repo.history.first.formattedSessionNumber, equals('777'));
|
||||
await repo.saveSession(session);
|
||||
expect(repo.sessions.length, equals(1));
|
||||
expect(repo.sessions.first.words.length, equals(3));
|
||||
expect(repo.sessions.first.words[0].word, equals('огонь'));
|
||||
expect(repo.sessions.first.words[1].word, equals('вода'));
|
||||
expect(repo.sessions.first.question, equals('В чем скрытый конфликт?'));
|
||||
|
||||
// Update with AI interpretation
|
||||
await repo.updateHistoryEntry('hist_1', aiInterpretation: 'Огонь призывает отпустить старые страхи');
|
||||
expect(repo.history.first.aiInterpretation, equals('Огонь призывает отпустить старые страхи'));
|
||||
await repo.updateSession('session_1', aiInterpretation: 'Связка огня и воды рождает баланс мира.');
|
||||
expect(repo.sessions.first.aiInterpretation, equals('Связка огня и воды рождает баланс мира.'));
|
||||
|
||||
await repo.clearHistory();
|
||||
expect(repo.history.isEmpty, isTrue);
|
||||
expect(repo.sessions.isEmpty, isTrue);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user