configure e2e proxy on mount
This commit is contained in:
@@ -26,13 +26,7 @@ appId: xyz.blueskyweb.app
|
|||||||
timeout: 180000
|
timeout: 180000
|
||||||
- tapOn: "Continue"
|
- tapOn: "Continue"
|
||||||
- back
|
- back
|
||||||
- extendedWaitUntil:
|
|
||||||
visible:
|
|
||||||
id: e2eConfigureProxy
|
|
||||||
timeout: 180000
|
|
||||||
- tapOn:
|
|
||||||
id: e2eConfigureProxy
|
|
||||||
- extendedWaitUntil:
|
- extendedWaitUntil:
|
||||||
visible:
|
visible:
|
||||||
id: e2eSignInAlice
|
id: e2eSignInAlice
|
||||||
timeout: 30000
|
timeout: 180000
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {useState} from 'react'
|
import {useEffect, useState} from 'react'
|
||||||
import {LogBox, Pressable, View} from 'react-native'
|
import {LogBox, Pressable, View} from 'react-native'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
@@ -37,6 +37,13 @@ export function TestCtrls() {
|
|||||||
const onboardingDispatch = useOnboardingDispatch()
|
const onboardingDispatch = useOnboardingDispatch()
|
||||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||||
const [isProxyConfigured, setIsProxyConfigured] = useState(hasConfiguredProxy)
|
const [isProxyConfigured, setIsProxyConfigured] = useState(hasConfiguredProxy)
|
||||||
|
useEffect(() => {
|
||||||
|
const header = `${DEV_ENV_APPVIEW_DID}#bsky_appview`
|
||||||
|
BLUESKY_PROXY_HEADER.set(header)
|
||||||
|
agent.configureProxy(header as any)
|
||||||
|
hasConfiguredProxy = true
|
||||||
|
setIsProxyConfigured(true)
|
||||||
|
}, [agent])
|
||||||
const onPressSignInAlice = async () => {
|
const onPressSignInAlice = async () => {
|
||||||
console.info('[E2E] Signing in as Alice')
|
console.info('[E2E] Signing in as Alice')
|
||||||
await login(
|
await login(
|
||||||
@@ -61,21 +68,8 @@ export function TestCtrls() {
|
|||||||
)
|
)
|
||||||
setShowLoggedOut(false)
|
setShowLoggedOut(false)
|
||||||
}
|
}
|
||||||
const configureProxy = () => {
|
|
||||||
const header = `${DEV_ENV_APPVIEW_DID}#bsky_appview`
|
|
||||||
BLUESKY_PROXY_HEADER.set(header)
|
|
||||||
agent.configureProxy(header as any)
|
|
||||||
hasConfiguredProxy = true
|
|
||||||
setIsProxyConfigured(true)
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<View style={{position: 'absolute', top: 100, right: 0, zIndex: 100}}>
|
<View style={{position: 'absolute', top: 100, right: 0, zIndex: 100}}>
|
||||||
<Pressable
|
|
||||||
testID="e2eConfigureProxy"
|
|
||||||
onPress={configureProxy}
|
|
||||||
accessibilityRole="button"
|
|
||||||
style={BTN}
|
|
||||||
/>
|
|
||||||
{isProxyConfigured && (
|
{isProxyConfigured && (
|
||||||
<>
|
<>
|
||||||
<Pressable
|
<Pressable
|
||||||
|
|||||||
Reference in New Issue
Block a user