Files
inji-wallet/components/CopilotTooltip.test.tsx
Kaushik Gupta 33c6caa08a INJIMOB-3246 Code coverage for Inji-Wallet repo increase above 5% (#2108)
* INJIMOB-3246 Code coverage for Inji-Wallet repo increase above 5%

Signed-off-by: Kaushik Gupta <kausgpt97@gmail.com>

* INJIMOB-3246: added snapshot tests and coverage increased to +4%

Signed-off-by: Kaushik Gupta <kausgpt97@gmail.com>

* removed duplicated lines

Signed-off-by: Kaushik Gupta <kausgpt97@gmail.com>

* Added updateCredentialInformation tests

Signed-off-by: Kaushik Gupta <kausgpt97@gmail.com>

* added code rabbit changes

Signed-off-by: Kaushik Gupta <kausgpt97@gmail.com>

* removed platform-specific tests without mocking

Signed-off-by: Kaushik Gupta <kausgpt97@gmail.com>

* standardize mocks in VcItemContainerProfileImage tests

Signed-off-by: Kaushik Gupta <kausgpt97@gmail.com>

---------

Signed-off-by: Kaushik Gupta <kausgpt97@gmail.com>
2025-11-07 11:10:37 +05:30

52 lines
1.4 KiB
TypeScript

import React from 'react';
import {render} from '@testing-library/react-native';
import {CopilotTooltip} from './CopilotTooltip';
// Mock ui components
jest.mock('./ui', () => ({
Button: jest.fn(() => null),
Column: ({children}: {children: React.ReactNode}) => <>{children}</>,
Row: ({children}: {children: React.ReactNode}) => <>{children}</>,
Text: ({children}: {children: React.ReactNode}) => <>{children}</>,
}));
// Mock controller
jest.mock('./CopilotTooltipController', () => ({
UseCopilotTooltip: jest.fn(() => ({
copilotEvents: {
on: jest.fn(),
},
SET_TOUR_GUIDE: jest.fn(),
ONBOARDING_DONE: jest.fn(),
INITIAL_DOWNLOAD_DONE: jest.fn(),
CURRENT_STEP: 1,
currentStepTitle: 'Step 1 Title',
currentStepDescription: 'Step 1 Description',
titleTestID: 'stepTitle',
descriptionTestID: 'stepDescription',
stepCount: '1/5',
isFirstStep: true,
isLastStep: false,
isFinalStep: false,
isOnboarding: true,
isInitialDownloading: false,
goToPrev: jest.fn(),
goToNext: jest.fn(),
stop: jest.fn(),
})),
}));
// Mock settings controller
jest.mock('../screens/Settings/SettingScreenController', () => ({
useSettingsScreen: jest.fn(() => ({
BACK: jest.fn(),
})),
}));
describe('CopilotTooltip Component', () => {
it('should match snapshot with first step', () => {
const {toJSON} = render(<CopilotTooltip />);
expect(toJSON()).toMatchSnapshot();
});
});