-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Add tests for Virtual Cards changes #2741
Conversation
spenderPlatformV1ApiService.get.and.returnValue(of(virtualCardUndefinedResponse)); | ||
|
||
virtualCardsService.getVirtualCard(virtualCardsRequest).subscribe((res) => { | ||
console.log(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove console.log
}); | ||
|
||
it('getCardDetailsInSerial(): should return serialised card details', () => { | ||
const virtualCardsCombinedRequest: VirtualCardsCombinedRequest = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declare this in separate virtual-cards-combined-request.data.ts
file and import here
[showAddCardSlide]="canAddCorporateCards$ | async" | ||
(addCardClick)="openAddCorporateCardPopover()" | ||
></app-spent-cards> | ||
<ng-container *ngIf="isVirtualCardsEnabled.enabled === true"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use <ng-container *ngIf="isVirtualCardsEnabled.enabled">
@@ -187,6 +201,40 @@ describe('ManageCorporateCardsPage', () => { | |||
expect(router.navigate).toHaveBeenCalledOnceWith(['/', 'enterprise', 'my_profile']); | |||
}); | |||
|
|||
describe('segmentChanged():', () => { | |||
it('should show Virtual Card page', () => { | |||
component.ionViewWillEnter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be called in test here?
); | ||
}); | ||
|
||
it('copyToClipboard(): should copy cvv on cvv copy icon tap', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add copyToClipboard
tests together using describe block (another test is at line 44)
component.ionViewWillEnter(); | ||
component.virtualCardDetails$.subscribe((virtualCardDetailsRes) => { | ||
expect(virtualCardDetailsRes).toBeDefined(); | ||
console.log(virtualCardDetailsRes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove console logs
|
||
component.ionViewWillEnter(); | ||
component.virtualCardDetails$.subscribe((virtualCardDetailsRes) => { | ||
expect(virtualCardDetailsRes).toBeDefined(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is defined what should be the value?
Some comments @bistaastha! Rest LGTM |
|
Description
copilot:summary
copilot:poem
Walkthrough
copilot:walkthrough
Clickup
Code Coverage
Please add code coverage here
UI Preview
Please add screenshots for UI changes