mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
switch spy to mock
This commit is contained in:
@@ -2,7 +2,6 @@ import { screen, waitFor } from "@testing-library/react-native";
|
||||
import ObsEdit from "components/ObsEdit/ObsEdit";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import * as useCurrentUser from "sharedHooks/useCurrentUser";
|
||||
import useStore from "stores/useStore";
|
||||
import factory from "tests/factory";
|
||||
import { renderComponent, wrapInNavigationContainer } from "tests/helpers/render";
|
||||
@@ -27,6 +26,11 @@ jest.mock( "sharedHooks/useWatchPosition", () => ( {
|
||||
|
||||
const mockUser = factory( "LocalUser" );
|
||||
|
||||
jest.mock( "sharedHooks/useCurrentUser", () => ( {
|
||||
__esModule: true,
|
||||
default: () => mockUser
|
||||
} ) );
|
||||
|
||||
const mockMutate = jest.fn();
|
||||
jest.mock( "sharedHooks/useAuthenticatedMutation", () => ( {
|
||||
__esModule: true,
|
||||
@@ -49,7 +53,6 @@ const mockObservation = factory( "LocalObservation", {
|
||||
|
||||
describe( "ObsEdit", () => {
|
||||
beforeEach( ( ) => {
|
||||
jest.spyOn( useCurrentUser, "default" ).mockImplementation( ( ) => mockUser );
|
||||
useStore.setState( {
|
||||
currentObservation: mockObservation,
|
||||
observations: [mockObservation]
|
||||
|
||||
Reference in New Issue
Block a user