mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-07 20:53:54 -05:00
* 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>
61 lines
1.6 KiB
TypeScript
61 lines
1.6 KiB
TypeScript
import React from 'react';
|
|
import {render} from '@testing-library/react-native';
|
|
import {HelpScreen} from './HelpScreen';
|
|
import {Text} from 'react-native';
|
|
|
|
// Mock Modal
|
|
jest.mock('./ui/Modal', () => ({
|
|
Modal: ({children}: {children: React.ReactNode}) => <>{children}</>,
|
|
}));
|
|
|
|
// Mock BannerNotificationContainer
|
|
jest.mock('./BannerNotificationContainer', () => ({
|
|
BannerNotificationContainer: jest.fn(() => null),
|
|
}));
|
|
|
|
// Mock API
|
|
jest.mock('../shared/api', () => ({
|
|
__esModule: true,
|
|
default: jest.fn(() =>
|
|
Promise.resolve({
|
|
aboutInjiUrl: 'https://docs.inji.io',
|
|
}),
|
|
),
|
|
}));
|
|
|
|
describe('HelpScreen Component', () => {
|
|
const triggerComponent = <Text>Help</Text>;
|
|
|
|
it('should match snapshot with Inji source', () => {
|
|
const {toJSON} = render(
|
|
<HelpScreen source="Inji" triggerComponent={triggerComponent} />,
|
|
);
|
|
expect(toJSON()).toMatchSnapshot();
|
|
});
|
|
|
|
it('should match snapshot with BackUp source', () => {
|
|
const {toJSON} = render(
|
|
<HelpScreen source="BackUp" triggerComponent={triggerComponent} />,
|
|
);
|
|
expect(toJSON()).toMatchSnapshot();
|
|
});
|
|
|
|
it('should match snapshot with keyManagement source', () => {
|
|
const {toJSON} = render(
|
|
<HelpScreen source="keyManagement" triggerComponent={triggerComponent} />,
|
|
);
|
|
expect(toJSON()).toMatchSnapshot();
|
|
});
|
|
|
|
it('should match snapshot when disabled', () => {
|
|
const {toJSON} = render(
|
|
<HelpScreen
|
|
source="Inji"
|
|
triggerComponent={triggerComponent}
|
|
isDisabled={true}
|
|
/>,
|
|
);
|
|
expect(toJSON()).toMatchSnapshot();
|
|
});
|
|
});
|