-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/codeSyntaxHighlighting-CMEM-4545
- Loading branch information
Showing
25 changed files
with
1,699 additions
and
2,754 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"extends": ["stylelint-config-standard-scss", "stylelint-config-recess-order"], | ||
"rules": { | ||
"scss/at-extend-no-missing-placeholder": null | ||
"scss/at-extend-no-missing-placeholder": null, | ||
"selector-class-pattern": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
|
||
export interface ReactFlowHotkeyContextProps { | ||
/** Allows to disable hot keys. */ | ||
disableHotKeys: (enable: boolean) => any | ||
|
||
/** If the hot keys are currently disabled. */ | ||
hotKeysDisabled: boolean | ||
} | ||
|
||
export const ReactFlowHotkeyContext = React.createContext<ReactFlowHotkeyContextProps>({ | ||
disableHotKeys: () => {}, | ||
hotKeysDisabled: false | ||
}) |
55 changes: 34 additions & 21 deletions
55
src/components/AutoSuggestion/tests/AutoSuggestion.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,50 @@ | ||
import React from "react"; | ||
import "@testing-library/jest-dom"; | ||
import {render} from "@testing-library/react"; | ||
import AutoSuggestion, {AutoSuggestionProps} from "../AutoSuggestion" | ||
import { render } from "@testing-library/react"; | ||
import AutoSuggestion, { AutoSuggestionProps } from "../AutoSuggestion"; | ||
|
||
describe("AutoSuggestion", () => { | ||
let props: AutoSuggestionProps | ||
let props: AutoSuggestionProps; | ||
|
||
beforeAll(() => { | ||
document.createRange = () => { | ||
const range = new Range(); | ||
range.getBoundingClientRect = jest.fn(); | ||
range.getClientRects = () => { | ||
return { | ||
item: () => null, | ||
length: 0, | ||
[Symbol.iterator]: jest.fn(), | ||
}; | ||
}; | ||
return range; | ||
}; | ||
}); | ||
|
||
beforeEach(() => { | ||
props = { | ||
label: "test value path", | ||
initialValue: "", | ||
onChange: jest.fn((value) => { | ||
}), | ||
onChange: jest.fn((value) => {}), | ||
fetchSuggestions: jest.fn((inputString, cursorPosition) => undefined), | ||
checkInput: jest.fn(inputString => ({ | ||
valid: true | ||
checkInput: jest.fn((inputString) => ({ | ||
valid: true, | ||
})), | ||
onInputChecked: jest.fn(validInput => { | ||
}), | ||
onInputChecked: jest.fn((validInput) => {}), | ||
validationErrorText: "", | ||
clearIconText: "", | ||
onFocusChange: jest.fn(hasFocus => { | ||
}), | ||
id: "test-auto-suggestion" | ||
} | ||
}) | ||
onFocusChange: jest.fn((hasFocus) => {}), | ||
id: "test-auto-suggestion", | ||
}; | ||
}); | ||
|
||
it("should render properly", () => { | ||
const {container} = render(<AutoSuggestion {...props} />) | ||
expect(container).not.toBeEmptyDOMElement() | ||
}) | ||
const { container } = render(<AutoSuggestion {...props} />); | ||
expect(container).not.toBeEmptyDOMElement(); | ||
}); | ||
|
||
it("should set label prop properly", () => { | ||
const {getByText} = render(<AutoSuggestion {...props}/>) | ||
expect(getByText(props.label!!)).toBeTruthy() | ||
}) | ||
}) | ||
const { getByText } = render(<AutoSuggestion {...props} />); | ||
expect(getByText(props.label!!)).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.