Resolve Lint errors in NotificationConsoleComponent.ts (#527)
This commit is contained in:
parent
02e6d8442b
commit
05932e1d38
|
@ -298,8 +298,6 @@ src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.t
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
|
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
|
||||||
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
||||||
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.test.tsx
|
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.test.tsx
|
||||||
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx
|
|
||||||
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponentAdapter.tsx
|
|
||||||
src/Explorer/Notebook/NotebookComponent/NotebookComponent.tsx
|
src/Explorer/Notebook/NotebookComponent/NotebookComponent.tsx
|
||||||
src/Explorer/Notebook/NotebookComponent/NotebookComponentAdapter.tsx
|
src/Explorer/Notebook/NotebookComponent/NotebookComponentAdapter.tsx
|
||||||
src/Explorer/Notebook/NotebookComponent/NotebookComponentBootstrapper.tsx
|
src/Explorer/Notebook/NotebookComponent/NotebookComponentBootstrapper.tsx
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import React from "react";
|
|
||||||
import { shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
|
import React from "react";
|
||||||
import {
|
import {
|
||||||
NotificationConsoleComponentProps,
|
|
||||||
NotificationConsoleComponent,
|
|
||||||
ConsoleDataType,
|
ConsoleDataType,
|
||||||
|
NotificationConsoleComponent,
|
||||||
|
NotificationConsoleComponentProps,
|
||||||
} from "./NotificationConsoleComponent";
|
} from "./NotificationConsoleComponent";
|
||||||
|
|
||||||
describe("NotificationConsoleComponent", () => {
|
describe("NotificationConsoleComponent", () => {
|
||||||
|
@ -12,7 +12,7 @@ describe("NotificationConsoleComponent", () => {
|
||||||
consoleData: undefined,
|
consoleData: undefined,
|
||||||
isConsoleExpanded: false,
|
isConsoleExpanded: false,
|
||||||
inProgressConsoleDataIdToBeDeleted: "",
|
inProgressConsoleDataIdToBeDeleted: "",
|
||||||
setIsConsoleExpanded: (isExpanded: boolean): void => {},
|
setIsConsoleExpanded: (): void => undefined,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ describe("NotificationConsoleComponent", () => {
|
||||||
wrapper.setProps(props);
|
wrapper.setProps(props);
|
||||||
expect(wrapper.find(".notificationConsoleData .date").text()).toEqual(date);
|
expect(wrapper.find(".notificationConsoleData .date").text()).toEqual(date);
|
||||||
expect(wrapper.find(".notificationConsoleData .message").text()).toEqual(message);
|
expect(wrapper.find(".notificationConsoleData .message").text()).toEqual(message);
|
||||||
expect(wrapper.exists(`.notificationConsoleData .${iconClassName}`));
|
expect(wrapper.exists(`.notificationConsoleData .${iconClassName}`)).toBe(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
it("renders progress notifications", () => {
|
it("renders progress notifications", () => {
|
||||||
|
@ -139,7 +139,7 @@ describe("NotificationConsoleComponent", () => {
|
||||||
wrapper.setProps(props);
|
wrapper.setProps(props);
|
||||||
|
|
||||||
wrapper.find(".clearNotificationsButton").simulate("click");
|
wrapper.find(".clearNotificationsButton").simulate("click");
|
||||||
expect(!wrapper.exists(".notificationConsoleData"));
|
expect(wrapper.exists(".notificationConsoleData")).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("collapses and hide content", () => {
|
it("collapses and hide content", () => {
|
||||||
|
@ -155,7 +155,7 @@ describe("NotificationConsoleComponent", () => {
|
||||||
wrapper.setProps(props);
|
wrapper.setProps(props);
|
||||||
|
|
||||||
wrapper.find(".notificationConsoleHeader").simulate("click");
|
wrapper.find(".notificationConsoleHeader").simulate("click");
|
||||||
expect(!wrapper.exists(".notificationConsoleContent"));
|
expect(wrapper.exists(".notificationConsoleContent")).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("display latest data in header", () => {
|
it("display latest data in header", () => {
|
||||||
|
|
|
@ -77,7 +77,7 @@ export class NotificationConsoleComponent extends React.Component<
|
||||||
public componentDidUpdate(
|
public componentDidUpdate(
|
||||||
prevProps: NotificationConsoleComponentProps,
|
prevProps: NotificationConsoleComponentProps,
|
||||||
prevState: NotificationConsoleComponentState
|
prevState: NotificationConsoleComponentState
|
||||||
) {
|
): void {
|
||||||
const currentHeaderStatus = NotificationConsoleComponent.extractHeaderStatus(this.props.consoleData);
|
const currentHeaderStatus = NotificationConsoleComponent.extractHeaderStatus(this.props.consoleData);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -98,7 +98,7 @@ export class NotificationConsoleComponent extends React.Component<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public setElememntRef = (element: HTMLElement) => {
|
public setElememntRef = (element: HTMLElement): void => {
|
||||||
this.consoleHeaderElement = element;
|
this.consoleHeaderElement = element;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ export class NotificationConsoleComponent extends React.Component<
|
||||||
className="notificationConsoleHeader"
|
className="notificationConsoleHeader"
|
||||||
id="notificationConsoleHeader"
|
id="notificationConsoleHeader"
|
||||||
ref={this.setElememntRef}
|
ref={this.setElememntRef}
|
||||||
onClick={(event: React.MouseEvent<HTMLDivElement>) => this.expandCollapseConsole()}
|
onClick={() => this.expandCollapseConsole()}
|
||||||
onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => this.onExpandCollapseKeyPress(event)}
|
onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => this.onExpandCollapseKeyPress(event)}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue