Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhepS committed Jul 27, 2023
1 parent ecb7da2 commit 80c1143
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { OpfOrderAdapter } from './opf-order.adapter';
import { OpfOrderConnector } from './opf-order.connector';

class MockOpfOrderAdapter implements OpfOrderAdapter {
placeOpfOrder = createSpy('placeOpfOrder').and.callFake((userId, cartId, termsChecked) =>
of(`load-${userId}-${cartId}-${termsChecked}`)
placeOpfOrder = createSpy('placeOpfOrder').and.callFake(
(userId, cartId, termsChecked) =>
of(`load-${userId}-${cartId}-${termsChecked}`)
);
}

Expand All @@ -32,7 +33,9 @@ describe('OpfOrderConnector', () => {

it('validate should call adapter', () => {
let result;
service.placeOpfOrder('user1', 'cart1', true).subscribe((res) => (result = res));
service
.placeOpfOrder('user1', 'cart1', true)
.subscribe((res) => (result = res));
expect(result).toEqual('load-user1-cart1-true');
expect(adapter.placeOpfOrder).toHaveBeenCalledWith('user1', 'cart1', true);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ describe('OpfPaymentConnector', () => {
});

it('should call adapter', () => {
service.verifyPayment('1', {responseMap: [{key: 'test', value: 'value'}]}).pipe(take(1)).subscribe();
expect(adapter.verifyPayment).toHaveBeenCalledWith('1', {responseMap: [{key: 'test', value: 'value'}]});
service
.verifyPayment('1', { responseMap: [{ key: 'test', value: 'value' }] })
.pipe(take(1))
.subscribe();
expect(adapter.verifyPayment).toHaveBeenCalledWith('1', {
responseMap: [{ key: 'test', value: 'value' }],
});
});

it('should call adapter', () => {
service.submitPayment({}, '1', '2').pipe(take(1)).subscribe();
expect(adapter.submitPayment).toHaveBeenCalledWith({}, '1', '2');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ describe('OtpConnector', () => {
service.generateOtpKey('user1', 'cart1').pipe(take(1)).subscribe();
expect(adapter.generateOtpKey).toHaveBeenCalledWith('user1', 'cart1');
});
});
});

0 comments on commit 80c1143

Please sign in to comment.