Files
inji-wallet/components/AccountInformation.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

43 lines
1.2 KiB
TypeScript

import React from 'react';
import {render} from '@testing-library/react-native';
import {AccountInformation} from './AccountInformation';
describe('AccountInformation Component', () => {
const defaultProps = {
email: 'test@example.com',
picture: 'https://example.com/avatar.jpg',
};
it('should match snapshot with email and picture', () => {
const {toJSON} = render(<AccountInformation {...defaultProps} />);
expect(toJSON()).toMatchSnapshot();
});
it('should match snapshot with different email', () => {
const {toJSON} = render(
<AccountInformation {...defaultProps} email="another@test.com" />,
);
expect(toJSON()).toMatchSnapshot();
});
it('should match snapshot with different picture URL', () => {
const {toJSON} = render(
<AccountInformation
{...defaultProps}
picture="https://example.com/different-avatar.jpg"
/>,
);
expect(toJSON()).toMatchSnapshot();
});
it('should match snapshot with long email', () => {
const {toJSON} = render(
<AccountInformation
{...defaultProps}
email="very.long.email.address@example-domain.com"
/>,
);
expect(toJSON()).toMatchSnapshot();
});
});