mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-08 05:03:56 -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>
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
import {render} from '@testing-library/react-native';
|
|
import {BackupAndRestoreBannerNotification} from './BackupAndRestoreBannerNotification';
|
|
|
|
// Mock controllers
|
|
jest.mock('../screens/backupAndRestore/BackupController', () => ({
|
|
useBackupScreen: jest.fn(() => ({
|
|
showBackupInProgress: false,
|
|
isBackingUpSuccess: false,
|
|
isBackingUpFailure: false,
|
|
backupErrorReason: '',
|
|
DISMISS: jest.fn(),
|
|
DISMISS_SHOW_BACKUP_IN_PROGRESS: jest.fn(),
|
|
})),
|
|
}));
|
|
|
|
jest.mock('../screens/Settings/BackupRestoreController', () => ({
|
|
useBackupRestoreScreen: jest.fn(() => ({
|
|
showRestoreInProgress: false,
|
|
isBackUpRestoreSuccess: false,
|
|
isBackUpRestoreFailure: false,
|
|
restoreErrorReason: '',
|
|
DISMISS: jest.fn(),
|
|
DISMISS_SHOW_RESTORE_IN_PROGRESS: jest.fn(),
|
|
})),
|
|
}));
|
|
|
|
// Mock BannerNotification
|
|
jest.mock('./BannerNotification', () => ({
|
|
BannerNotification: jest.fn(() => null),
|
|
BannerStatusType: {
|
|
IN_PROGRESS: 'inProgress',
|
|
SUCCESS: 'success',
|
|
ERROR: 'error',
|
|
},
|
|
}));
|
|
|
|
describe('BackupAndRestoreBannerNotification Component', () => {
|
|
it('should match snapshot with no banners', () => {
|
|
const {toJSON} = render(<BackupAndRestoreBannerNotification />);
|
|
expect(toJSON()).toMatchSnapshot();
|
|
});
|
|
});
|