import 'package:cyberhybridhub/models/incoming_question.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { group('IncomingQuestion spelling routing', () { test('pending spelling uses word tile even with slider presentation', () { final IncomingQuestion question = IncomingQuestion( id: 'spell-pending', text: 'Spelling question loading…', sentAt: DateTime.utc(2026, 1, 1), sourceId: 'spelling', presentation: 'market_glyph_slider', needsPrepare: true, ); expect(question.usesSpellingWordTile, isTrue); expect(question.isSpellingFollowUp, isFalse); }); test('spelling follow-up uses slider tile', () { final IncomingQuestion question = IncomingQuestion( id: 'spell-follow', text: "Correct — 'colour' is the proper spelling. Enter +1 for another word.", sentAt: DateTime.utc(2026, 1, 1), sourceId: 'spelling', presentation: 'market_glyph_slider', ); expect(question.isSpellingFollowUp, isTrue); expect(question.usesSpellingWordTile, isFalse); }); test('prepared spelling with spokenWord uses word tile', () { final IncomingQuestion question = IncomingQuestion( id: 'spell-ready', text: 'Spell the word you hear.', sentAt: DateTime.utc(2026, 1, 1), sourceId: 'spelling', presentation: 'market_glyph_slider', spokenWord: 'colour', audioTitle: 'spell-ready', ); expect(question.usesSpellingWordTile, isTrue); }); }); }