From 249ec7214e009660dc2d74e441a7363a32afc052 Mon Sep 17 00:00:00 2001 From: Satya Patel <14907857+saddlepaddle@users.noreply.github.com> Date: Sun, 18 Oct 2026 01:17:12 +0000 Subject: [PATCH] test(mobile): guard the dev-launcher flags that hide dev overlays for agents expo-dev-launcher 57.0.20 reads disableAutoLaunch=1 and disableFab=1 from the expo-development-client URL and writes them to the dev menu preferences. With them, an agent-driven EAS simulator session opens with no dev-menu sheet and no floating gear over the header. No native rebuild is needed. This test fails if an Expo upgrade drops the flags, because the overlays would then come back without any error. --- .../expo-dev-launcher-agent-flags.test.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 apps/mobile/expo-dev-launcher-agent-flags.test.ts diff --git a/apps/mobile/expo-dev-launcher-agent-flags.test.ts b/apps/mobile/expo-dev-launcher-agent-flags.test.ts new file mode 100644 index 00000000000..d8f1a5c4e1c --- /dev/null +++ b/apps/mobile/expo-dev-launcher-agent-flags.test.ts @@ -0,0 +1,28 @@ +import { describe, expect, test } from "bun:test"; +import { readFileSync } from "node:fs"; +import { dirname, join } from "node:path"; + +// scripts/eas-dev.sh opens the dev client with these flags so the dev menu +// does not open at launch and its floating button does not cover the header +// while an agent drives the app. An Expo bump that drops them brings both back +// without any error. +const devLauncherDir = dirname( + require.resolve("expo-dev-launcher/package.json", { + paths: [require.resolve("expo-dev-client/package.json")], + }), +); + +describe("expo-dev-launcher URL flags for agent-driven sessions", () => { + test("disableAutoLaunch and disableFab update the dev menu preferences", () => { + const source = readFileSync( + join(devLauncherDir, "ios/EXDevLauncherURLHelper.swift"), + "utf8", + ); + expect(source).toMatch( + /hasEnabledFlag\("disableFab", in: url\)\s*\{\s*DevMenuManager\.shared\.setShowFloatingActionButton\(false\)/, + ); + expect(source).toMatch( + /hasEnabledFlag\("disableAutoLaunch", in: url\)\s*\{\s*DevMenuPreferences\.isOnboardingFinished = true\s*DevMenuManager\.shared\.setShowsAtLaunch\(false\)/, + ); + }); +});