mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix TopBarRegistry references
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
157f4846da
commit
c53febbfbf
@ -25,8 +25,8 @@ import "@testing-library/jest-dom/extend-expect";
|
||||
|
||||
jest.mock("../../../extensions/registries");
|
||||
|
||||
import { topBarRegistry } from "../../../extensions/registries";
|
||||
import { TopBar } from "../layout/topbar";
|
||||
import { TopBarRegistry } from "../../../extensions/registries";
|
||||
|
||||
describe("<TopBar/>", () => {
|
||||
it("renders w/o errors", () => {
|
||||
@ -45,7 +45,7 @@ describe("<TopBar/>", () => {
|
||||
const testId = "testId";
|
||||
const text = "an item";
|
||||
|
||||
topBarRegistry.getItems = jest.fn().mockImplementationOnce(() => [
|
||||
TopBarRegistry.getInstance().getItems = jest.fn().mockImplementationOnce(() => [
|
||||
{
|
||||
components: {
|
||||
Item: <span data-testid={testId}>{text}</span>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
import styles from "./topbar.module.css";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { topBarRegistry } from "../../../extensions/registries";
|
||||
import { TopBarRegistry } from "../../../extensions/registries";
|
||||
|
||||
interface Props extends React.HTMLAttributes<any> {
|
||||
label: React.ReactNode;
|
||||
@ -30,7 +30,7 @@ interface Props extends React.HTMLAttributes<any> {
|
||||
|
||||
export const TopBar = observer(({ label, children, ...rest }: Props) => {
|
||||
const renderRegisteredItems = () => {
|
||||
const items = topBarRegistry.getItems();
|
||||
const items = TopBarRegistry.getInstance().getItems();
|
||||
|
||||
if (!Array.isArray(items)) {
|
||||
return null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user