## Description - Enabled the rule `@typescript-eslint/no-explicit-any` - Suppressed errors with comment ``` // TODO: Fix this the next time the file is edited // eslint-disable-next-line @typescript-eslint/no-explicit-any ``` Fixes #35308 ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10181176984> > Commit: 7fc604e24fa234da7ab2ff56e0b1c715268796ee > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10181176984&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 31 Jul 2024 15:00:45 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No
55 lines
1.8 KiB
TypeScript
55 lines
1.8 KiB
TypeScript
import React from "react";
|
|
import { render, screen } from "test/testUtils";
|
|
import DynamicInputTextControl from "./DynamicInputTextControl";
|
|
import { reduxForm } from "redux-form";
|
|
import { mockCodemirrorRender } from "test/__mocks__/CodeMirrorEditorMock";
|
|
import userEvent from "@testing-library/user-event";
|
|
import { waitFor } from "@testing-library/react";
|
|
|
|
// TODO: Fix this the next time the file is edited
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
function TestForm(props: any) {
|
|
return <div>{props.children}</div>;
|
|
}
|
|
|
|
const ReduxFormDecorator = reduxForm({
|
|
form: "TestForm",
|
|
initialValues: { actionConfiguration: { testPath: "My test value" } },
|
|
})(TestForm);
|
|
|
|
describe("DynamicInputTextControl", () => {
|
|
beforeEach(() => {
|
|
// eslint-disable-next-line testing-library/no-render-in-lifecycle
|
|
mockCodemirrorRender();
|
|
});
|
|
it("renders correctly", () => {
|
|
render(
|
|
<ReduxFormDecorator>
|
|
<DynamicInputTextControl
|
|
actionName="Test action"
|
|
configProperty="actionConfiguration.testPath"
|
|
controlType="DYNAMIC_INPUT_TEXT_CONTROL"
|
|
dataType={"TABLE"}
|
|
formName="TestForm"
|
|
id={"test"}
|
|
isValid
|
|
label="Action"
|
|
onPropertyChange={jest.fn()}
|
|
placeholderText="Test placeholder"
|
|
/>
|
|
</ReduxFormDecorator>,
|
|
{},
|
|
);
|
|
|
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
waitFor(async () => {
|
|
const input = screen.getAllByText("My test value")[0];
|
|
// eslint-disable-next-line testing-library/no-wait-for-side-effects
|
|
await userEvent.type(input, "New text");
|
|
await expect(screen.getAllByText("New text")).toHaveLength(2);
|
|
// eslint-disable-next-line testing-library/await-async-queries
|
|
await expect(screen.findByText("My test value")).toBeNull();
|
|
});
|
|
});
|
|
});
|