diff --git a/src/ageAssurance/debug.ts b/src/ageAssurance/debug.ts index d31024755c..20ed6174eb 100644 --- a/src/ageAssurance/debug.ts +++ b/src/ageAssurance/debug.ts @@ -5,10 +5,10 @@ import { } from '@atproto/api' import {type OtherRequiredData} from '#/ageAssurance/data' -import {IS_DEV} from '#/env' +import {IS_DEV, IS_E2E} from '#/env' 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 ? { @@ -30,29 +30,9 @@ export const config: AppBskyAgeassuranceDefs.Config = { countryCode: 'AA', regionCode: undefined, 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, - access: 'safe', + access: 'full', }, ], }, @@ -68,17 +48,17 @@ export const serverState: AppBskyAgeassuranceGetState.OutputSchema | undefined = serverStateEnabled ? { state: { - lastInitiatedAt: new Date(2023, 5, 1).toISOString(), + lastInitiatedAt: new Date(2025, 1, 1).toISOString(), status: 'assured', - access: 'safe', + access: 'full', }, metadata: { - accountCreatedAt: new Date(2023, 11, 1).toISOString(), + accountCreatedAt: new Date(2023, 1, 1).toISOString(), }, } : undefined export async function resolve(data: T) { - await new Promise(y => setTimeout(y, 2000)) // simulate network + await new Promise(y => setTimeout(y, 500)) // simulate network return data } diff --git a/src/env/common.ts b/src/env/common.ts index 621e8076ef..b0d75d403b 100644 --- a/src/env/common.ts +++ b/src/env/common.ts @@ -30,6 +30,11 @@ export const IS_TESTFLIGHT = ENV === 'testflight' */ 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 */ diff --git a/src/geolocation/debug.ts b/src/geolocation/debug.ts index 58fe05e6f2..f062a94cef 100644 --- a/src/geolocation/debug.ts +++ b/src/geolocation/debug.ts @@ -14,6 +14,6 @@ export const deviceGeolocation: Geolocation = aaDebug.deviceGeolocation ?? { } export async function resolve(data: T) { - await new Promise(y => setTimeout(y, 2000)) // simulate network + await new Promise(y => setTimeout(y, 500)) // simulate network return data }