我想测试当我在输入(inputA)中键入一个值时,另一个输入(inputB)会更新为一个值。
inputA 接受邮政编码,例如:“10999”,在 inputB 显示位置后:“Berlin”
这适用于实际的应用程序,我输入 inputA,然后 inputB 会更新。
当 ome 在 inputA 上键入时,会调度一个操作,然后 inputB 从 redux 状态获取一个新值。
这是我的测试代码,您知道为什么它在测试中不使用“Ort”占位符更新输入,但在实际应用程序中却这样做吗?
import { render, withIntl, withStore, configureStore, withState } from "test-utils-react-testing-library";
import { screen, fireEvent, withHistory, withRoute, within } from "@testing-library/react";
import configureMockStore from 'redux-mock-store';
import ProfileForm from "./ProfileForm";
import PersonalDetails from "../PersonalDetails/PersonalDetails";
const STATE = {
locations: { locations: {} },
streets: { streets: {} },
password: {}
};
const mockStore = configureMockStore();
const STORE = mockStore({
streets: {
isFetching: false, …Run Code Online (Sandbox Code Playgroud)