fix flaky e2e proxy setup

This commit is contained in:
Samuel Newman
2026-07-28 09:49:34 +03:00
parent 82c505f286
commit b6f3d94b8d
2 changed files with 18 additions and 9 deletions
+2 -1
View File
@@ -33,4 +33,5 @@ appId: xyz.blueskyweb.app
- tapOn: - tapOn:
id: e2eProxyHeaderInput id: e2eProxyHeaderInput
- inputText: ${output.result} - inputText: ${output.result}
- pressKey: Enter - tapOn:
id: e2eConfigureProxy
+16 -8
View File
@@ -1,5 +1,5 @@
import {useState} from 'react' import {useState} from 'react'
import {LogBox, Pressable, TextInput, View} from 'react-native' import {Keyboard, LogBox, Pressable, TextInput, View} from 'react-native'
import {useQueryClient} from '@tanstack/react-query' import {useQueryClient} from '@tanstack/react-query'
import {BLUESKY_PROXY_HEADER} from '#/lib/constants' import {BLUESKY_PROXY_HEADER} from '#/lib/constants'
@@ -62,6 +62,14 @@ export function TestCtrls() {
setShowLoggedOut(false) setShowLoggedOut(false)
} }
const [proxyHeader, setProxyHeader] = useState('') const [proxyHeader, setProxyHeader] = useState('')
const configureProxy = () => {
const header = `${proxyHeader}#bsky_appview`
BLUESKY_PROXY_HEADER.set(header)
agent.configureProxy(header as any)
hasConfiguredProxy = true
setIsProxyConfigured(true)
Keyboard.dismiss()
}
return ( return (
<View style={{position: 'absolute', top: 100, right: 0, zIndex: 100}}> <View style={{position: 'absolute', top: 100, right: 0, zIndex: 100}}>
<TextInput <TextInput
@@ -72,13 +80,13 @@ export function TestCtrls() {
autoComplete="off" autoComplete="off"
autoCorrect={false} autoCorrect={false}
autoCapitalize="none" autoCapitalize="none"
onSubmitEditing={() => { onSubmitEditing={configureProxy}
const header = `${proxyHeader}#bsky_appview` style={BTN}
BLUESKY_PROXY_HEADER.set(header) />
agent.configureProxy(header as any) <Pressable
hasConfiguredProxy = true testID="e2eConfigureProxy"
setIsProxyConfigured(true) onPress={configureProxy}
}} accessibilityRole="button"
style={BTN} style={BTN}
/> />
{isProxyConfigured && ( {isProxyConfigured && (