Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(mobile): cover login navigation option stability

nothingyuancando23f33eb30964
diff --git a/apps/mobile/src/__tests__/navigationOptionsStability.test.tsx b/apps/mobile/src/__tests__/navigationOptionsStability.test.tsx
index 22fe7959c0..68b2e81443 100644
--- a/apps/mobile/src/__tests__/navigationOptionsStability.test.tsx
+++ b/apps/mobile/src/__tests__/navigationOptionsStability.test.tsx
@@ -53,4 +53,15 @@ describe('navigation option stability', () => {
);
expect(seenScreenOptions.at(-1)).not.toBe(initialOptions);
});
+
+ it('keeps the login screen status-bar options memoized by its only visual input', async () => {
+ const { readFile } = await import('node:fs/promises');
+ const { resolve } = await import('node:path');
+ const source = await readFile(resolve(process.cwd(), 'app/(auth)/login.tsx'), 'utf8');
+
+ expect(source).toContain("const loginStatusBarOptions = useMemo(() => ({");
+ expect(source).toContain("statusBarStyle: stageTheme === 'dark' ? 'light' : 'dark',");
+ expect(source).toContain("} as const), [stageTheme]);");
+ expect(source).toContain('<Stack.Screen options={loginStatusBarOptions} />');
+ });
});