実装例
1
口座の情報をprops
から受け取って、それが整形されて返ってくるhooks
のテスト
describe(__dirname, () => {
it('should return the correct text for a domestic bank transfer', async () => {
const bankAccount: any = {
transfer_method: 'domestic',
bank_name: 'Test Bank',
branch_name: 'Test Branch',
account_type: 'checking',
account_number: '123456789',
account_holder_name: 'Test User',
};
const { result } = renderHook(() => useRemittanceText({ bankAccount }));
await waitFor(() => {
expect(result.current.get).toEqual({
section1: 'Test Bank Test Branch',
section2: '
当座 123456789
Test User',
});
});
});
});