Files
pipelines/app/test/features/runs/actions/retry_intent_web_test.dart
T
alan c53dedc544 feat(app): wire retry and restart into the native run detail
Render Retry beside Rename on a stopped failed run under both native
hosts, send only {run_id, request_key} for resume and add
retry_mode=restart for a fresh start, and open the run the accepted
reply names. Keep hidden actions out of the Wrap so native 8/4 dp
spacing is not doubled, and use a literal 2^32 entropy bound because
dart2js evaluates 1 << 32 as 0.

Adds wiring, guard and layout tests, a browser-only key regression and
the retry probe; notes/R2c-wire.md records the checks and limits.
2026-10-21 22:49:26 +01:00

26 lines
916 B
Dart

@TestOn('browser')
library;
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/runs/actions/retry_intent.dart';
void main() {
test('a fresh key uses the full entropy bound under dart2js', () {
// `1 << 32` compiles to 0 on the web, so Random.nextInt threw a RangeError
// and no retry request was ever sent. Generating without an injected
// random value exercises the real bound; a VM test cannot catch this
// class of bug, so this file runs only in a browser:
//
// flutter test --platform chrome \
// test/features/runs/actions/retry_intent_web_test.dart
final keys = <String>{};
for (var index = 0; index < 32; index++) {
final key = newRetryRequestKey(7);
expect(key, startsWith('app-retry-7-'));
expect(key.length, lessThanOrEqualTo(128));
keys.add(key);
}
expect(keys, hasLength(32));
});
}