From 403ae4694c7460097bfd2017f41c17ab29fef4a6 Mon Sep 17 00:00:00 2001 From: Green00101 <2585640230@qq.com> Date: Fri, 1 May 2026 08:54:57 +1000 Subject: [PATCH] fix: add google.maps.Animation mock --- src/drawing/marker/constants.test.ts | 25 +++++++++++++++++++++++++ src/drawing/marker/constants.ts | 20 ++++++++++++++++++++ src/index.ts | 3 +++ 3 files changed, 48 insertions(+) create mode 100644 src/drawing/marker/constants.test.ts create mode 100644 src/drawing/marker/constants.ts diff --git a/src/drawing/marker/constants.test.ts b/src/drawing/marker/constants.test.ts new file mode 100644 index 000000000..e8467d5ba --- /dev/null +++ b/src/drawing/marker/constants.test.ts @@ -0,0 +1,25 @@ +/** + * Copyright 2022 Google LLC. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { initialize } from "../../index"; + +test("animation constants", () => { + initialize(); + expect(google.maps.Animation).toMatchObject({ + BOUNCE: 0, + DROP: 1, + }); +}); diff --git a/src/drawing/marker/constants.ts b/src/drawing/marker/constants.ts new file mode 100644 index 000000000..30937d3c3 --- /dev/null +++ b/src/drawing/marker/constants.ts @@ -0,0 +1,20 @@ +/** + * Copyright 2022 Google LLC. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export enum Animation { + BOUNCE = 0, + DROP = 1, +} diff --git a/src/index.ts b/src/index.ts index e499614d4..36f48355c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -63,6 +63,7 @@ import { PinElement } from "./drawing/advanced-marker-element/pin-element"; import { FeatureLayer } from "./maps/maps/featurelayer"; import { event } from "./maps/event/event"; import { mockInstances } from "./registry"; +import { Animation } from "./drawing/marker/constants"; const initialize = function (): void { mockInstances.clearAll(); @@ -79,6 +80,7 @@ const initialize = function (): void { Size: Size, MVCObject: MVCObject, MVCArray: MVCArray, + Animation: Animation, MapTypeId: MapTypeId, ControlPosition: ControlPosition, LatLng: LatLng, @@ -168,5 +170,6 @@ export { FeatureLayer, importLibrary, mockInstances, + Animation, initialize, };