Files
iNaturalistReactNative/e2e/signedOut.e2e.js
budowski 7b8c88c84d feat: add onboarding carousel (#2285)
Note that offsetting the onboarding images ended up being a bit hard. We're
mostly doing so with a cropped version of one of the images.

Closes #1906

Also tried to de-flake some tests:

* Use fake timers when possible
* Ensure time travel helper doesn't un-fake our timers
* Wait for time travel helper to finish so changes don't happen outside of
  act
* Stop mocking useCurrentUser in integration tests; that's app code and should
  not be mocked when integrating all parts of the app; instead use signIn /
  signOut helpers
* Remove unnecessary direct uses of act()
* Mocked some inatjs calls to prevent React Query complaints about undefined
  query return values
* Close onboarding before all e2e tests

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-11-04 12:03:55 -08:00

35 lines
1.3 KiB
JavaScript

import {
by,
device,
element,
expect,
waitFor
} from "detox";
import { iNatE2eBeforeAll, iNatE2eBeforeEach } from "./helpers";
import closeOnboarding from "./sharedFlows/closeOnboarding";
describe( "Signed out user", () => {
beforeAll( async ( ) => iNatE2eBeforeAll( device ) );
beforeEach( async ( ) => iNatE2eBeforeEach( device ) );
it( "should start at My Observations with log in text", async () => {
await closeOnboarding( );
const loginText = element( by.id( "log-in-to-iNaturalist-button.text" ) );
await waitFor( loginText ).toBeVisible( ).withTimeout( 10000 );
await expect( loginText ).toBeVisible( );
} );
// it( "should add an observation without evidence", async () => {
// const addObsButton = element( by.id( "add-obs-button" ) );
// await waitFor( addObsButton ).toBeVisible( ).withTimeout( 10000 );
// await addObsButton.tap( );
// await expect( element( by.id( "identify-text" ) ) ).toBeVisible();
// const obsWithoutEvidenceButton = element( by.id( "observe-without-evidence-button" ) );
// await expect( obsWithoutEvidenceButton ).toBeVisible( );
// await obsWithoutEvidenceButton.tap( );
// await waitFor( element( by.id( "new-observation-text" ) ) )
// .toBeVisible( ).withTimeout( 10000 );
// } );
} );