Files
pipelines/app/test/features/templates/data/template_confirmation_test.dart
T

26 lines
754 B
Dart

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<TemplateRepositoryException>()),
);
expect(gateway.calls.single.fields['create_only'], isTrue);
}
},
);
}