1
0
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:
Alex Andreev 2021-06-11 10:07:22 +03:00
parent 157f4846da
commit c53febbfbf
2 changed files with 4 additions and 4 deletions

View File

@ -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>

View File

@ -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;