feat(app): show template stage counts
This commit is contained in:
@@ -31,10 +31,31 @@ void main() {
|
||||
expect(find.byKey(templatesGalleryKey), findsOneWidget);
|
||||
expect(find.text('Release workflow'), findsOneWidget);
|
||||
expect(find.text('Ship a version'), findsOneWidget);
|
||||
expect(find.text('2 stages'), findsNWidgets(2));
|
||||
expect(find.text('(unnamed template)'), findsOneWidget);
|
||||
expect(find.byKey(templatesLoadingKey), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('stage count is unavailable when server parsing refuses', (
|
||||
tester,
|
||||
) async {
|
||||
final gateway =
|
||||
GalleryGateway((type, fields) async => templatesReply(galleryTemplates))
|
||||
..validationHandler = (type, fields) async {
|
||||
throw Exception('invalid definition');
|
||||
};
|
||||
|
||||
await pumpGallery(tester, gateway);
|
||||
|
||||
expect(find.text('stage count unavailable'), findsNWidgets(2));
|
||||
expect(find.text('0 stages'), findsNothing);
|
||||
expect(gateway.callsOf('validate'), hasLength(2));
|
||||
expect(
|
||||
gateway.callsOf('validate').first.fields['source'],
|
||||
galleryTemplates.first['source'],
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('an empty catalogue states it without inventing rows', (
|
||||
tester,
|
||||
) async {
|
||||
@@ -148,7 +169,11 @@ void main() {
|
||||
expect(selectableSource(source), findsOneWidget);
|
||||
expect(selectableSource('release'), findsOneWidget);
|
||||
expect(find.text(templateCreateActionLabel), findsOneWidget);
|
||||
expect(gateway.callsOf('validate'), isEmpty);
|
||||
expect(gateway.callsOf('validate'), hasLength(2));
|
||||
expect(
|
||||
gateway.callsOf('validate').map((call) => call.fields['source']),
|
||||
everyElement(source),
|
||||
);
|
||||
expect(gateway.callsOf('submit'), isEmpty);
|
||||
|
||||
await tester.tap(find.byKey(templatesBackKey));
|
||||
|
||||
Reference in New Issue
Block a user