Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions apps/mobile/expo-dev-launcher-agent-flags.test.ts
Original file line number Diff line number Diff line change
@@ -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\)/,
);
});
});
Loading