aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/hoc
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2022-10-19 14:46:14 +0200
committersonartech <sonartech@sonarsource.com>2022-10-21 20:03:18 +0000
commit8a3b8052254c1198495ef26abc024d26917bdef0 (patch)
treefb3621f0caa3ee1c9690ab309b10049302a0a648 /server/sonar-web/src/main/js/components/hoc
parent067e6587f1423b9b14cc7094422d47971c734764 (diff)
downloadsonarqube-8a3b8052254c1198495ef26abc024d26917bdef0.tar.gz
sonarqube-8a3b8052254c1198495ef26abc024d26917bdef0.zip
[NO-JIRA] Fix eslint errors
Diffstat (limited to 'server/sonar-web/src/main/js/components/hoc')
-rw-r--r--server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx42
-rw-r--r--server/sonar-web/src/main/js/components/hoc/__tests__/withNotifications-test.tsx2
3 files changed, 23 insertions, 23 deletions
diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx
index 94948c10831..3f4c0d904a7 100644
--- a/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/__tests__/whenLoggedIn-test.tsx
@@ -40,7 +40,7 @@ it('should render for logged in user', () => {
it('should not render for anonymous user', () => {
const wrapper = shallowRender(false);
expect(getRenderedType(wrapper)).toBeNull();
- expect(handleRequiredAuthentication).toBeCalled();
+ expect(handleRequiredAuthentication).toHaveBeenCalled();
});
function getRenderedType(wrapper: ShallowWrapper) {
diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx
index 4655585f85f..d1b0c500b03 100644
--- a/server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx
@@ -65,32 +65,32 @@ it('should correctly bind key events for component navigation', () => {
);
keydown({ key: KeyboardKeys.DownArrow });
- expect(onHighlight).toBeCalledWith(COMPONENTS[2]);
- expect(onSelect).not.toBeCalled();
+ expect(onHighlight).toHaveBeenCalledWith(COMPONENTS[2]);
+ expect(onSelect).not.toHaveBeenCalled();
keydown({ key: KeyboardKeys.UpArrow });
keydown({ key: KeyboardKeys.UpArrow });
- expect(onHighlight).toBeCalledWith(COMPONENTS[0]);
- expect(onSelect).not.toBeCalled();
+ expect(onHighlight).toHaveBeenCalledWith(COMPONENTS[0]);
+ expect(onSelect).not.toHaveBeenCalled();
keydown({ key: KeyboardKeys.UpArrow });
- expect(onHighlight).toBeCalledWith(COMPONENTS[2]);
+ expect(onHighlight).toHaveBeenCalledWith(COMPONENTS[2]);
keydown({ key: KeyboardKeys.DownArrow });
- expect(onHighlight).toBeCalledWith(COMPONENTS[0]);
+ expect(onHighlight).toHaveBeenCalledWith(COMPONENTS[0]);
keydown({ key: KeyboardKeys.RightArrow, metaKey: true });
- expect(onSelect).not.toBeCalled();
+ expect(onSelect).not.toHaveBeenCalled();
keydown({ key: KeyboardKeys.RightArrow });
- expect(onSelect).toBeCalledWith(COMPONENTS[0]);
+ expect(onSelect).toHaveBeenCalledWith(COMPONENTS[0]);
keydown({ key: KeyboardKeys.Enter });
- expect(onSelect).toBeCalledWith(COMPONENTS[0]);
+ expect(onSelect).toHaveBeenCalledWith(COMPONENTS[0]);
keydown({ key: KeyboardKeys.LeftArrow, metaKey: true });
- expect(onGoToParent).not.toBeCalled();
+ expect(onGoToParent).not.toHaveBeenCalled();
keydown({ key: KeyboardKeys.LeftArrow });
- expect(onGoToParent).toBeCalled();
+ expect(onGoToParent).toHaveBeenCalled();
});
it('should support not cycling through elements, and triggering a callback on reaching the last element', () => {
@@ -107,18 +107,18 @@ it('should support not cycling through elements, and triggering a callback on re
);
keydown({ key: KeyboardKeys.DownArrow });
- expect(onHighlight).toBeCalledWith(COMPONENTS[0]);
+ expect(onHighlight).toHaveBeenCalledWith(COMPONENTS[0]);
keydown({ key: KeyboardKeys.DownArrow });
keydown({ key: KeyboardKeys.DownArrow });
keydown({ key: KeyboardKeys.DownArrow });
- expect(onHighlight).toBeCalledWith(COMPONENTS[2]);
- expect(onEndOfList).toBeCalled();
+ expect(onHighlight).toHaveBeenCalledWith(COMPONENTS[2]);
+ expect(onEndOfList).toHaveBeenCalled();
keydown({ key: KeyboardKeys.UpArrow });
keydown({ key: KeyboardKeys.UpArrow });
keydown({ key: KeyboardKeys.UpArrow });
keydown({ key: KeyboardKeys.UpArrow });
- expect(onHighlight).toBeCalledWith(COMPONENTS[0]);
+ expect(onHighlight).toHaveBeenCalledWith(COMPONENTS[0]);
});
it('should correctly bind key events for codeview navigation', () => {
@@ -136,22 +136,22 @@ it('should correctly bind key events for codeview navigation', () => {
})
);
- expect(onHighlight).not.toBeCalled();
+ expect(onHighlight).not.toHaveBeenCalled();
keydown({ key: KeyboardKeys.DownArrow });
- expect(onHighlight).not.toBeCalled();
+ expect(onHighlight).not.toHaveBeenCalled();
keydown({ key: KeyboardKeys.UpArrow });
- expect(onHighlight).not.toBeCalled();
+ expect(onHighlight).not.toHaveBeenCalled();
keydown({ key: KeyboardKeys.RightArrow });
- expect(onSelect).not.toBeCalled();
+ expect(onSelect).not.toHaveBeenCalled();
keydown({ key: KeyboardKeys.Enter });
- expect(onSelect).not.toBeCalled();
+ expect(onSelect).not.toHaveBeenCalled();
keydown({ key: KeyboardKeys.LeftArrow });
- expect(onGoToParent).toBeCalled();
+ expect(onGoToParent).toHaveBeenCalled();
});
function applyProps(props: Partial<WithKeyboardNavigationProps> = {}) {
diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/withNotifications-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/withNotifications-test.tsx
index 0bd982d2d33..c29439d7f6e 100644
--- a/server/sonar-web/src/main/js/components/hoc/__tests__/withNotifications-test.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/__tests__/withNotifications-test.tsx
@@ -69,7 +69,7 @@ it('should fetch notifications and render', async () => {
const wrapper = shallowRender();
await waitAndUpdate(wrapper);
expect(wrapper).toMatchSnapshot();
- expect(getNotifications).toBeCalled();
+ expect(getNotifications).toHaveBeenCalled();
});
it('should add and remove a notification', () => {