@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 = {}; 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)); }); }