import 'package:flutter_test/flutter_test.dart'; import 'package:pipelines_app/features/templates/data/template_repository.dart'; import 'template_test_support.dart'; void main() { test( 'a malformed created detail never becomes a claimed successful create', () async { for (final id in [null, 0, -1, 'unknown', 1.5]) { final gateway = RecordingGateway([ { 'type': 'submitted', 'detail': {'id': id, 'name': 'Unconfirmed'}, }, ]); await expectLater( TemplateRepository(gateway).submit('Topic', source), throwsA(isA()), ); expect(gateway.calls.single.fields['create_only'], isTrue); } }, ); }