Skip to content

Commit

Permalink
chore: fix unit
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea committed Mar 25, 2024
1 parent e41cfc3 commit f700fc8
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import {TuiSvgModule} from '@taiga-ui/core';
import {TuiNativeInputPO} from '@taiga-ui/testing';
import type {Mock} from 'jest-mock';
import {firstValueFrom, timer} from 'rxjs';

describe('InputCardGrouped', () => {
@Component({
Expand Down Expand Up @@ -175,10 +176,12 @@ describe('InputCardGrouped', () => {
expect(inputCardPO.focused).toBe(true);
});

it('focuses expire input when valid card is entered', () => {
it('focuses expire input when valid card is entered', async () => {
inputCardPO.focus();
inputCardPO.sendText('563693784073');

await firstValueFrom(timer(100));

expect(inputExpirePO.focused).toBe(true);
});

Expand All @@ -190,11 +193,13 @@ describe('InputCardGrouped', () => {
expect(inputExpirePO.focused).toBe(true);
});

it('focuses cvc input when expiration date is fully entered', () => {
it('focuses cvc input when expiration date is fully entered', async () => {
inputCardPO.focus();
inputCardPO.sendText('563693784073');
inputExpirePO.sendText('12/21');

await firstValueFrom(timer(100));

expect(inputCVCPO.focused).toBe(true);
});
});
Expand Down

0 comments on commit f700fc8

Please sign in to comment.