mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 10:51:30 +00:00
Compare commits
3 Commits
add-dp-rba
...
unhandled-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ccac4b8741 | ||
|
|
0e841e34a6 | ||
|
|
b4cc0f8e52 |
@@ -88,16 +88,18 @@ export class IndexingPolicyComponent extends React.Component<
|
||||
private async createIndexingPolicyEditor(): Promise<void> {
|
||||
const value: string = JSON.stringify(this.props.indexingPolicyContent, undefined, 4);
|
||||
const monaco = await loadMonaco();
|
||||
this.indexingPolicyEditor = monaco.editor.create(this.indexingPolicyDiv.current, {
|
||||
value: value,
|
||||
language: "json",
|
||||
readOnly: isIndexTransforming(this.props.indexTransformationProgress),
|
||||
ariaLabel: "Indexing Policy",
|
||||
});
|
||||
if (this.indexingPolicyEditor) {
|
||||
const indexingPolicyEditorModel = this.indexingPolicyEditor.getModel();
|
||||
indexingPolicyEditorModel.onDidChangeContent(this.onEditorContentChange.bind(this));
|
||||
this.props.logIndexingPolicySuccessMessage();
|
||||
if (monaco.editor) {
|
||||
this.indexingPolicyEditor = monaco.editor.create(this.indexingPolicyDiv.current, {
|
||||
value: value,
|
||||
language: "json",
|
||||
readOnly: isIndexTransforming(this.props.indexTransformationProgress),
|
||||
ariaLabel: "Indexing Policy",
|
||||
});
|
||||
if (this.indexingPolicyEditor) {
|
||||
const indexingPolicyEditorModel = this.indexingPolicyEditor.getModel();
|
||||
indexingPolicyEditorModel.onDidChangeContent(this.onEditorContentChange.bind(this));
|
||||
this.props.logIndexingPolicySuccessMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,17 +138,19 @@ describe("D3ForceGraph", () => {
|
||||
|
||||
it("should call onHighlightedNode callback when mouse hovering over node", () => {
|
||||
forceGraph.params.onGraphUpdated = () => {
|
||||
const mouseoverEvent = document.createEvent("Events");
|
||||
mouseoverEvent.initEvent("mouseover", true, false);
|
||||
$(rootNode).find(".node")[0].dispatchEvent(mouseoverEvent); // [0] is v1 vertex
|
||||
expect($(rootNode).find(".node")[0]).toBe(1);
|
||||
if (document) {
|
||||
const mouseoverEvent = document.createEvent("Events");
|
||||
mouseoverEvent.initEvent("mouseover", true, false);
|
||||
$(rootNode).find(".node")[0].dispatchEvent(mouseoverEvent); // [0] is v1 vertex
|
||||
|
||||
// onHighlightedNode is always called once to clear the selection
|
||||
expect((forceGraph.params.onHighlightedNode as sinon.SinonSpy).calledTwice).toBe(true);
|
||||
// onHighlightedNode is always called once to clear the selection
|
||||
expect((forceGraph.params.onHighlightedNode as sinon.SinonSpy).calledTwice).toBe(true);
|
||||
|
||||
const onHighlightedNode = (forceGraph.params.onHighlightedNode as sinon.SinonSpy).args[1][0] as D3GraphNodeData;
|
||||
expect(onHighlightedNode).not.toBe(null);
|
||||
expect(onHighlightedNode.id).toEqual(v1Id);
|
||||
const onHighlightedNode = (forceGraph.params.onHighlightedNode as sinon.SinonSpy)
|
||||
.args[1][0] as D3GraphNodeData;
|
||||
expect(onHighlightedNode).not.toBe(null);
|
||||
expect(onHighlightedNode.id).toEqual(v1Id);
|
||||
}
|
||||
};
|
||||
|
||||
forceGraph.updateGraph(newGraph, forceGraph.igraphConfig);
|
||||
|
||||
@@ -1084,7 +1084,6 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
|
||||
public static reportToConsole(type: ConsoleDataType, msg: string, ...errorData: any[]): void | (() => void) {
|
||||
let errorDataStr: string = "";
|
||||
if (errorData && errorData.length > 0) {
|
||||
console.error(msg, errorData);
|
||||
errorDataStr = ": " + JSON.stringify(errorData);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export class MiddlePaneComponent extends React.Component<MiddlePaneComponentProp
|
||||
onClick={this.props.toggleExpandGraph}
|
||||
role="button"
|
||||
aria-expanded={this.props.isTabsContentExpanded}
|
||||
aria-name="View graph in full screen"
|
||||
aria-label="View graph in full screen"
|
||||
tabIndex={0}
|
||||
>
|
||||
<img
|
||||
|
||||
@@ -78,7 +78,7 @@ export default class NotebookManager {
|
||||
this.notebookContentProvider = new NotebookContentProvider(
|
||||
this.inMemoryContentProvider,
|
||||
this.gitHubContentProvider,
|
||||
contents.JupyterContentProvider
|
||||
contents?.JupyterContentProvider
|
||||
);
|
||||
|
||||
this.notebookClient = new NotebookContainerClient(() =>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { initializeIcons } from "@fluentui/react";
|
||||
import { configure } from "enzyme";
|
||||
import Adapter from "enzyme-adapter-react-16";
|
||||
import "jest-canvas-mock";
|
||||
import { initializeIcons } from "@fluentui/react";
|
||||
import { TextDecoder, TextEncoder } from "util";
|
||||
configure({ adapter: new Adapter() });
|
||||
initializeIcons();
|
||||
@@ -16,3 +16,12 @@ if (typeof window.URL.createObjectURL === "undefined") {
|
||||
require("jquery-ui-dist/jquery-ui");
|
||||
(<any>global).TextEncoder = TextEncoder;
|
||||
(<any>global).TextDecoder = TextDecoder;
|
||||
|
||||
// In Node v7 unhandled promise rejections
|
||||
if (process.env.LISTENING_TO_UNHANDLED_REJECTION !== "true") {
|
||||
process.on("unhandledRejection", (reason) => {
|
||||
console.error("reason", reason);
|
||||
});
|
||||
// Avoid memory leak by adding too many listeners
|
||||
process.env.LISTENING_TO_UNHANDLED_REJECTION = "true";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user