test: improve utils coverage (#4230)
* test: improve utils coverage * refactor: review - rename isDefined to isNonNullable, update tests and return statement
This commit is contained in:
@ -8,7 +8,7 @@ import {
|
||||
} from '@/ui/utilities/pointer-event/hooks/useListenClickOutsideV2';
|
||||
import { ClickOutsideListenerCallback } from '@/ui/utilities/pointer-event/types/ClickOutsideListenerCallback';
|
||||
import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/getScopeIdFromComponentId';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
|
||||
export const useClickOutsideListener = (componentId: string) => {
|
||||
// TODO: improve typing
|
||||
@ -67,7 +67,7 @@ export const useClickOutsideListener = (componentId: string) => {
|
||||
(callback) => callback.callbackId === callbackId,
|
||||
);
|
||||
|
||||
if (!isDefined(existingCallbackWithSameId)) {
|
||||
if (!isNonNullable(existingCallbackWithSameId)) {
|
||||
const existingCallbacksWithNewCallback = existingCallbacks.concat({
|
||||
callbackId,
|
||||
callbackFunction,
|
||||
|
||||
Reference in New Issue
Block a user