@@ -2,7 +2,11 @@ import { test, expect } from 'vitest';
22import fs from 'node:fs' ;
33import os from 'node:os' ;
44import path from 'node:path' ;
5- import { buildReplayTargetDeviceResolution } from '../replay-device-selection.ts' ;
5+ import { parseReplayInput } from '../../compat/replay-input.ts' ;
6+ import {
7+ buildReplayScriptPlatformFlags ,
8+ buildReplayTargetDeviceResolution ,
9+ } from '../replay-device-selection.ts' ;
610
711test ( 'replay leaves deep-link opens to normal device resolution' , ( ) => {
812 const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'agent-device-replay-device-selection-' ) ) ;
@@ -20,6 +24,18 @@ test('replay leaves deep-link opens to normal device resolution', () => {
2024 ) . toBeUndefined ( ) ;
2125} ) ;
2226
27+ test ( 'native replay applies its authored platform before a first deep link' , ( ) => {
28+ expect (
29+ buildReplayScriptPlatformFlags (
30+ undefined ,
31+ parseReplayInput (
32+ 'runtime set --platform ios --metro-port 8081\nopen demo://checkout\nopen com.example.demo\n' ,
33+ undefined ,
34+ ) . actions ,
35+ ) ,
36+ ) . toEqual ( { platform : 'ios' } ) ;
37+ } ) ;
38+
2339test ( 'native replay uses its authored Android runtime setting without an iOS app probe' , ( ) => {
2440 const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'agent-device-replay-device-selection-' ) ) ;
2541 const replayPath = path . join ( root , 'android.ad' ) ;
0 commit comments