Add e2e debug support for AA
This commit is contained in:
@@ -5,10 +5,10 @@ import {
|
|||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
|
|
||||||
import {type OtherRequiredData} from '#/ageAssurance/data'
|
import {type OtherRequiredData} from '#/ageAssurance/data'
|
||||||
import {IS_DEV} from '#/env'
|
import {IS_DEV, IS_E2E} from '#/env'
|
||||||
import {type Geolocation} from '#/geolocation'
|
import {type Geolocation} from '#/geolocation'
|
||||||
|
|
||||||
export const enabled = IS_DEV && false
|
export const enabled = (IS_DEV && false) || IS_E2E
|
||||||
|
|
||||||
export const geolocation: Geolocation | undefined = enabled
|
export const geolocation: Geolocation | undefined = enabled
|
||||||
? {
|
? {
|
||||||
@@ -30,29 +30,9 @@ export const config: AppBskyAgeassuranceDefs.Config = {
|
|||||||
countryCode: 'AA',
|
countryCode: 'AA',
|
||||||
regionCode: undefined,
|
regionCode: undefined,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
|
||||||
$type: ids.IfAccountNewerThan,
|
|
||||||
date: '2025-12-01T00:00:00Z',
|
|
||||||
access: 'none',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$type: ids.IfAssuredOverAge,
|
|
||||||
age: 18,
|
|
||||||
access: 'full',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$type: ids.IfAssuredOverAge,
|
|
||||||
age: 16,
|
|
||||||
access: 'safe',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$type: ids.IfDeclaredUnderAge,
|
|
||||||
age: 16,
|
|
||||||
access: 'none',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
$type: ids.Default,
|
$type: ids.Default,
|
||||||
access: 'safe',
|
access: 'full',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -68,17 +48,17 @@ export const serverState: AppBskyAgeassuranceGetState.OutputSchema | undefined =
|
|||||||
serverStateEnabled
|
serverStateEnabled
|
||||||
? {
|
? {
|
||||||
state: {
|
state: {
|
||||||
lastInitiatedAt: new Date(2023, 5, 1).toISOString(),
|
lastInitiatedAt: new Date(2025, 1, 1).toISOString(),
|
||||||
status: 'assured',
|
status: 'assured',
|
||||||
access: 'safe',
|
access: 'full',
|
||||||
},
|
},
|
||||||
metadata: {
|
metadata: {
|
||||||
accountCreatedAt: new Date(2023, 11, 1).toISOString(),
|
accountCreatedAt: new Date(2023, 1, 1).toISOString(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
export async function resolve<T>(data: T) {
|
export async function resolve<T>(data: T) {
|
||||||
await new Promise(y => setTimeout(y, 2000)) // simulate network
|
await new Promise(y => setTimeout(y, 500)) // simulate network
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+5
@@ -30,6 +30,11 @@ export const IS_TESTFLIGHT = ENV === 'testflight'
|
|||||||
*/
|
*/
|
||||||
export const IS_DEV = __DEV__
|
export const IS_DEV = __DEV__
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether the app is running in a test environment
|
||||||
|
*/
|
||||||
|
export const IS_E2E = ENV === 'e2e'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the app is `__DEV__` or TestFlight
|
* Indicates whether the app is `__DEV__` or TestFlight
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ export const deviceGeolocation: Geolocation = aaDebug.deviceGeolocation ?? {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function resolve<T>(data: T) {
|
export async function resolve<T>(data: T) {
|
||||||
await new Promise(y => setTimeout(y, 2000)) // simulate network
|
await new Promise(y => setTimeout(y, 500)) // simulate network
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user