diff --git a/packages/cardano/src/wallet/lib/__tests__/get-inputs-value.test.ts b/packages/cardano/src/wallet/lib/__tests__/get-inputs-value.test.ts
index 0a1efcee1..c94847ee2 100644
--- a/packages/cardano/src/wallet/lib/__tests__/get-inputs-value.test.ts
+++ b/packages/cardano/src/wallet/lib/__tests__/get-inputs-value.test.ts
@@ -250,7 +250,7 @@ describe('Testing getTxInputsValueAndAddress function', () => {
]);
const result = getTxInputsValueAndAddress(
- Array.from({ length: 30 }).map((_, index) => ({ index, txId: 'txId1' }) as unknown as Cardano.TxIn),
+ Array.from({ length: 30 }).map((_, index) => ({ index, txId: 'txId1' } as unknown as Cardano.TxIn)),
{
transactionsByHashes
} as unknown as ChainHistoryProvider,
@@ -285,7 +285,7 @@ describe('Testing getTxInputsValueAndAddress function', () => {
);
const result = getTxInputsValueAndAddress(
- Array.from({ length: 30 }).map((_, index) => ({ index: 0, txId: `txId${index}` }) as Cardano.TxIn),
+ Array.from({ length: 30 }).map((_, index) => ({ index: 0, txId: `txId${index}` } as Cardano.TxIn)),
{
transactionsByHashes
} as unknown as ChainHistoryProvider,
diff --git a/packages/common/src/ui/components/CollapsablePanel/__tests__/CollapsablePanel.test.tsx b/packages/common/src/ui/components/CollapsablePanel/__tests__/CollapsablePanel.test.tsx
index e07a218f8..596bd718e 100644
--- a/packages/common/src/ui/components/CollapsablePanel/__tests__/CollapsablePanel.test.tsx
+++ b/packages/common/src/ui/components/CollapsablePanel/__tests__/CollapsablePanel.test.tsx
@@ -22,7 +22,7 @@ describe('CollapsablePanel', () => {
);
const clickable = queryByRole('button');
act(() => {
- fireEvent.click(clickable);
+ clickable && fireEvent.click(clickable);
});
expect(queryByTestId('test-content')).toBeInTheDocument();
});
diff --git a/packages/common/src/ui/components/Drawer/__tests__/DrawerNavigation.test.tsx b/packages/common/src/ui/components/Drawer/__tests__/DrawerNavigation.test.tsx
index c36f91036..3918a03c4 100644
--- a/packages/common/src/ui/components/Drawer/__tests__/DrawerNavigation.test.tsx
+++ b/packages/common/src/ui/components/Drawer/__tests__/DrawerNavigation.test.tsx
@@ -15,7 +15,7 @@ describe('DrawerNavigation', () => {
const { queryByTestId } = render();
const backButton = queryByTestId('navigation-button-arrow');
expect(backButton).toBeInTheDocument();
- fireEvent.click(backButton);
+ backButton && fireEvent.click(backButton);
expect(onClick).toHaveBeenCalled();
});
test('shows close button if on click function is defined', () => {
@@ -23,7 +23,7 @@ describe('DrawerNavigation', () => {
const { queryByTestId } = render();
const closeButton = queryByTestId('navigation-button-cross');
expect(closeButton).toBeInTheDocument();
- fireEvent.click(closeButton);
+ closeButton && fireEvent.click(closeButton);
expect(onClick).toHaveBeenCalled();
});
test('shows left actions if passed as props instead of back arrow', () => {
diff --git a/packages/common/src/ui/components/Form/Input/__tests__/Input.test.tsx b/packages/common/src/ui/components/Form/Input/__tests__/Input.test.tsx
index e9729638c..060a0c4a4 100644
--- a/packages/common/src/ui/components/Form/Input/__tests__/Input.test.tsx
+++ b/packages/common/src/ui/components/Form/Input/__tests__/Input.test.tsx
@@ -15,7 +15,7 @@ describe('Input', () => {
const input = queryByTestId('input-test');
expect(input).toHaveValue('');
act(() => {
- fireEvent.change(input, { target: { value: 'new value' } });
+ input && fireEvent.change(input, { target: { value: 'new value' } });
});
expect(input).toHaveValue('new value');
expect(onChange).toHaveBeenCalled();
diff --git a/packages/common/src/ui/components/Form/TextArea/__tests__/TextArea.test.tsx b/packages/common/src/ui/components/Form/TextArea/__tests__/TextArea.test.tsx
index bc17123d7..6bc72eb5a 100644
--- a/packages/common/src/ui/components/Form/TextArea/__tests__/TextArea.test.tsx
+++ b/packages/common/src/ui/components/Form/TextArea/__tests__/TextArea.test.tsx
@@ -15,7 +15,7 @@ describe('TextArea', () => {
const area = queryByTestId('text-area-test');
expect(area).toHaveValue('');
act(() => {
- fireEvent.change(area, { target: { value: 'new value' } });
+ area && fireEvent.change(area, { target: { value: 'new value' } });
});
expect(area).toHaveValue('new value');
expect(onChange).toHaveBeenCalled();
@@ -24,7 +24,8 @@ describe('TextArea', () => {
const onBlur = jest.fn();
const { queryByTestId } = render();
await waitFor(() => {
- fireEvent.blur(queryByTestId('text-area-test'));
+ const area = queryByTestId('text-area-test');
+ area && fireEvent.blur(area);
});
expect(onBlur).toHaveBeenCalled();
});
diff --git a/packages/common/src/ui/components/Search/__tests__/Search.test.tsx b/packages/common/src/ui/components/Search/__tests__/Search.test.tsx
index 653a63187..0f5aa1a07 100644
--- a/packages/common/src/ui/components/Search/__tests__/Search.test.tsx
+++ b/packages/common/src/ui/components/Search/__tests__/Search.test.tsx
@@ -14,7 +14,8 @@ describe('Search', () => {
const onInputBlur = jest.fn();
const { queryByTestId } = render();
act(() => {
- fireEvent.blur(queryByTestId('search-input'));
+ const input = queryByTestId('search-input');
+ input && fireEvent.blur(input);
});
expect(onInputBlur).toHaveBeenCalled();
});
@@ -22,7 +23,8 @@ describe('Search', () => {
const onInputFocus = jest.fn();
const { queryByTestId } = render();
act(() => {
- fireEvent.focus(queryByTestId('search-input'));
+ const input = queryByTestId('search-input');
+ input && fireEvent.focus(input);
});
expect(onInputFocus).toHaveBeenCalled();
});
@@ -32,7 +34,7 @@ describe('Search', () => {
const clearButton = queryByTestId('search-clear-button');
expect(clearButton).toBeInTheDocument();
act(() => {
- fireEvent.click(clearButton);
+ clearButton && fireEvent.click(clearButton);
});
expect(onClearButtonClick).toHaveBeenCalled();
});
diff --git a/packages/common/src/ui/components/Toast/__tests__/Toast.test.tsx b/packages/common/src/ui/components/Toast/__tests__/Toast.test.tsx
index 62b871210..cf9a3b109 100644
--- a/packages/common/src/ui/components/Toast/__tests__/Toast.test.tsx
+++ b/packages/common/src/ui/components/Toast/__tests__/Toast.test.tsx
@@ -18,9 +18,10 @@ const ToastContainer = ({ text, duration, withProgressBar }: ToastProps) => {
};
describe('Testing TextContent component', () => {
+ const duration = 10;
const props: ToastProps = {
text: 'test text',
- duration: 10,
+ duration,
withProgressBar: true
};
@@ -82,6 +83,6 @@ describe('Testing TextContent component', () => {
setTimeout(() => {
expect(screen.queryAllByText(props.text)).toHaveLength(0);
- }, props.duration + 1);
+ }, duration + 1);
});
});