feat(app): wire the native pipelines browser on the shared session
Register the landed PipelinesScreen at /pipelines through AppSession, with an honest first-connection gate, a native reconnect banner that retains the open list and detail, and an in-place refresh on reconnect. Move the shared connection chrome out of RunsDestination so both destinations use one implementation and one wording. Add destination, registration and reconnect coverage plus an isolated loopback Chrome probe that drives the real runPipelinesApp() composition.
This commit is contained in:
@@ -5,8 +5,11 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/application/pipelines_app.dart';
|
||||
import 'package:pipelines_app/application/server_endpoint.dart';
|
||||
import 'package:pipelines_app/core/transport/pipelines_client.dart';
|
||||
import 'package:pipelines_app/features/pipelines/screen.dart';
|
||||
|
||||
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
|
||||
import '../features/pipelines/fixtures.dart';
|
||||
import 'pipelines_replies.dart';
|
||||
|
||||
ServerEndpoint webServer() => ServerEndpoint.resolve(
|
||||
base: Uri.parse('http://127.0.0.1:8096/'),
|
||||
@@ -125,18 +128,32 @@ void main() {
|
||||
|
||||
await pumpApp(tester, channel: channel, client: client, provider: provider);
|
||||
expect(provider.value.uri.path, '/pipelines');
|
||||
final fixture = PipelineFixture();
|
||||
await replyPipelines(tester, channel, fixture);
|
||||
final pipelinesRunsId =
|
||||
pipelineRequest(channel, 'list_runs')!['id'] as String;
|
||||
|
||||
await tester.tap(find.text('Runs').last);
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/runs');
|
||||
|
||||
await replyList(
|
||||
final runsRequest = await waitForLaterRequest(
|
||||
tester,
|
||||
channel,
|
||||
runs: [
|
||||
{'id': 2, 'name': 'Beta run', 'status': 'failed'},
|
||||
],
|
||||
'list_runs',
|
||||
pipelinesRunsId,
|
||||
);
|
||||
channel.incoming.add(
|
||||
jsonEncode({
|
||||
'id': runsRequest['id'],
|
||||
'type': 'runs',
|
||||
'runs': [
|
||||
{'id': 2, 'name': 'Beta run', 'status': 'failed'},
|
||||
],
|
||||
}),
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
await tester.tap(find.text('Beta run'));
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/runs/2');
|
||||
@@ -172,6 +189,10 @@ void main() {
|
||||
|
||||
await pumpApp(tester, channel: channel, client: client, provider: provider);
|
||||
expect(provider.value.uri.path, '/pipelines');
|
||||
expect(find.text('Pipelines — Not implemented'), findsOneWidget);
|
||||
await replyPipelines(tester, channel, PipelineFixture());
|
||||
expect(find.byType(PipelinesScreen), findsOneWidget);
|
||||
expect(find.text('Pipelines — Not implemented'), findsNothing);
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user