Skip to content

Commit

Permalink
chore(): refine types
Browse files Browse the repository at this point in the history
  • Loading branch information
weareoutman committed Sep 4, 2024
1 parent b7f131b commit d8cb188
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { describe, test, expect } from "@jest/globals";
import { waitFor, act, render, fireEvent } from "@testing-library/react";
import { showDialog, DialogComponent } from "./show-dialog.js";

jest.mock("@next-core/theme", () => ({}));

// <sl-dialog> uses those API which is not supported in jsdom.
Element.prototype.getAnimations = jest.fn().mockReturnValue([]);
Element.prototype.animate = jest.fn().mockReturnValue({
Expand Down
8 changes: 4 additions & 4 deletions bricks/basic/src/data-providers/show-dialog/show-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { i18n, initializeI18n } from "@next-core/i18n";
import { createRoot } from "react-dom/client";
import { wrapBrick } from "@next-core/react-element";
import type { AntdIcon, AntdIconProps } from "@next-bricks/icons/antd-icon";
import { get } from "lodash";
import "@next-core/theme";
import { K, NS, locales } from "./i18n.js";
import { SlDialogElement, WrappedSlDialog } from "./sl-dialog.js";
import { Button, ButtonProps } from "../../button/index.js";
import type { ReactNextElement } from "@next-core/react-element";
import { get } from "lodash";
import type { Button, ButtonProps } from "../../button/index.js";
import styles from "./dialog.module.css";

initializeI18n(NS, locales);
Expand All @@ -26,7 +26,7 @@ interface InputEventsMap {
onValueChange: "change";
}
const WrappedInput = wrapBrick<
ReactNextElement,
HTMLElement,
InputProps,
InputEvents,
InputEventsMap
Expand Down
5 changes: 4 additions & 1 deletion bricks/basic/src/tooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React, { CSSProperties, useEffect, useRef, useState } from "react";
import { EventEmitter, createDecorators } from "@next-core/element";
import { ReactNextElement, wrapBrick } from "@next-core/react-element";
import type {
GeneralIcon,
GeneralIconProps,
} from "@next-bricks/icons/general-icon";
import "@next-core/theme";
import styleText from "./styles.shadow.css";
import {
Expand All @@ -10,7 +14,6 @@ import {
ARROW_SIZE,
DISTANCE,
} from "./sl-tooltip.js";
import { GeneralIcon, GeneralIconProps } from "@next-bricks/icons/general-icon";

const { defineElement, property, method, event } = createDecorators();
const WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>("eo-icon");
Expand Down

0 comments on commit d8cb188

Please sign in to comment.