Skip to content

Commit

Permalink
rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Oct 17, 2024
1 parent 73705c6 commit d5ab8a6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { fireEvent, render, waitFor } from "@testing-library/react";
import localization from "../../../../localization/localization.json";
import { Language, SupportedLanguages } from "../../../../shared/language";
import { ILatLong } from "../modal-geo";
import { UpdateButton } from "./update-button";
import { UpdateButtonWrapper } from "./update-button-wrapper";
import { UpdateGeoLocation } from "./update-geo-location";

jest.mock("./update-geo-location");
Expand All @@ -25,7 +25,7 @@ describe("UpdateButton", () => {
(UpdateGeoLocation as jest.Mock).mockResolvedValueOnce({} as any);

const { getByTestId } = render(
<UpdateButton
<UpdateButtonWrapper
handleExit={handleExit}
isLocationUpdated={true}
parentDirectory={parentDirectory}
Expand All @@ -44,7 +44,7 @@ describe("UpdateButton", () => {

it("disables button when location is not updated", () => {
const { getByText } = render(
<UpdateButton
<UpdateButtonWrapper
handleExit={handleExit}
isLocationUpdated={false}
parentDirectory={parentDirectory}
Expand All @@ -61,7 +61,7 @@ describe("UpdateButton", () => {

it("enables button when location is updated", () => {
const { getByText } = render(
<UpdateButton
<UpdateButtonWrapper
handleExit={handleExit}
isLocationUpdated={true}
parentDirectory={parentDirectory}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ILatLong } from "../modal-geo";
import { UpdateButtonActive } from "./update-button-active";
import { UpdateButtonDisabled } from "./update-button-disabled";

interface UpdateButtonProps {
interface IUpdateButtonWrapperProps {
parentDirectory: string;
selectedSubPath: string;
location: ILatLong;
Expand All @@ -17,7 +17,7 @@ interface UpdateButtonProps {
handleExit: (result: IGeoLocationModel | null) => void;
}

export const UpdateButton: React.FC<UpdateButtonProps> = ({
export const UpdateButtonWrapper: React.FC<IUpdateButtonWrapperProps> = ({
parentDirectory,
selectedSubPath,
location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as AddDefaultMarker from "./internal/add-default-marker";
import { GetZoom } from "./internal/get-zoom";
import { OnDrag } from "./internal/on-drag";
import { RealtimeMapUpdate } from "./internal/realtime-map-update";
import * as UpdateButton from "./internal/update-button";
import * as UpdateButtonWrapper from "./internal/update-button-wrapper";
import * as updateGeoLocation from "./internal/update-geo-location";
import ModalGeo, { ILatLong } from "./modal-geo";

Expand Down Expand Up @@ -194,7 +194,7 @@ describe("ModalGeo", () => {

it("check if form is disabled it hides the button", async () => {
const updateButtonSpy = jest
.spyOn(UpdateButton, "UpdateButton")
.spyOn(UpdateButtonWrapper, "UpdateButtonWrapper")
.mockImplementationOnce(() => {
return <div>test</div>;
});
Expand All @@ -219,7 +219,7 @@ describe("ModalGeo", () => {

it("check if form is enabled it shows the button", () => {
const updateButtonSpy = jest
.spyOn(UpdateButton, "UpdateButton")
.spyOn(UpdateButtonWrapper, "UpdateButtonWrapper")
.mockImplementationOnce(() => {
return <div>test</div>;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Modal from "../../atoms/modal/modal";
import Preloader from "../../atoms/preloader/preloader";
import { LatLongRound } from "./internal/lat-long-round";
import { RealtimeMapUpdate } from "./internal/realtime-map-update";
import { UpdateButton } from "./internal/update-button";
import { UpdateButtonWrapper } from "./internal/update-button-wrapper";
import { UpdateMap } from "./internal/update-map";

interface IModalMoveFileProps {
Expand Down Expand Up @@ -122,7 +122,7 @@ const ModalGeo: React.FunctionComponent<IModalMoveFileProps> = ({
{language.key(localization.MessageCancel)}
</button>
{isFormEnabled ? (
<UpdateButton
<UpdateButtonWrapper
handleExit={props.handleExit}
isLocationUpdated={isLocationUpdated}
parentDirectory={parentDirectory}
Expand Down

0 comments on commit d5ab8a6

Please sign in to comment.