Rename KindInput to ModelKindDropdown
This commit is contained in:
@@ -11,7 +11,7 @@ import { vscode } from "../vscode-api";
|
||||
|
||||
import { Method } from "../../model-editor/method";
|
||||
import { ModeledMethod } from "../../model-editor/modeled-method";
|
||||
import { KindInput } from "./KindInput";
|
||||
import { ModelKindDropdown } from "./ModelKindDropdown";
|
||||
import { extensiblePredicateDefinitions } from "../../model-editor/predicates";
|
||||
import { Mode } from "../../model-editor/shared/mode";
|
||||
import { MethodClassifications } from "./MethodClassifications";
|
||||
@@ -154,7 +154,7 @@ function ModelableMethodRow(props: MethodRowProps) {
|
||||
/>
|
||||
</VSCodeDataGridCell>
|
||||
<VSCodeDataGridCell gridColumn={5}>
|
||||
<KindInput
|
||||
<ModelKindDropdown
|
||||
kinds={predicate?.supportedKinds || []}
|
||||
value={modeledMethod?.kind}
|
||||
disabled={!showKindCell}
|
||||
|
||||
@@ -13,7 +13,7 @@ type Props = {
|
||||
"aria-label"?: string;
|
||||
};
|
||||
|
||||
export const KindInput = ({
|
||||
export const ModelKindDropdown = ({
|
||||
kinds,
|
||||
value,
|
||||
disabled,
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as React from "react";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { KindInput } from "../KindInput";
|
||||
import { ModelKindDropdown } from "../ModelKindDropdown";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
|
||||
describe(KindInput.name, () => {
|
||||
describe(ModelKindDropdown.name, () => {
|
||||
const onChange = jest.fn();
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -12,7 +12,7 @@ describe(KindInput.name, () => {
|
||||
|
||||
it("allows changing the kind", async () => {
|
||||
render(
|
||||
<KindInput
|
||||
<ModelKindDropdown
|
||||
kinds={["local", "remote"]}
|
||||
value="local"
|
||||
onChange={onChange}
|
||||
@@ -26,7 +26,7 @@ describe(KindInput.name, () => {
|
||||
|
||||
it("resets the kind when changing the supported kinds", () => {
|
||||
const { rerender } = render(
|
||||
<KindInput
|
||||
<ModelKindDropdown
|
||||
kinds={["local", "remote"]}
|
||||
value={"local"}
|
||||
onChange={onChange}
|
||||
@@ -37,7 +37,7 @@ describe(KindInput.name, () => {
|
||||
expect(onChange).not.toHaveBeenCalled();
|
||||
|
||||
rerender(
|
||||
<KindInput
|
||||
<ModelKindDropdown
|
||||
kinds={["sql-injection", "log-injection", "url-redirection"]}
|
||||
value="local"
|
||||
onChange={onChange}
|
||||
@@ -49,7 +49,7 @@ describe(KindInput.name, () => {
|
||||
|
||||
it("sets the kind when value is undefined", () => {
|
||||
render(
|
||||
<KindInput
|
||||
<ModelKindDropdown
|
||||
kinds={["local", "remote"]}
|
||||
value={undefined}
|
||||
onChange={onChange}
|
||||
Reference in New Issue
Block a user