Skip to content

Commit 0769497

Browse files
committed
refactor: 코드래빗 리뷰 반영
1 parent 5c8f0a9 commit 0769497

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/repositories/__test__/qr.repo.integration.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ describe('QRLoginTokenRepository 통합 테스트', () => {
7676
await repo.createQRLoginToken(token, TEST_DATA.USER_ID, ip, userAgent);
7777
const foundToken = await repo.findQRLoginToken(token);
7878

79+
// 토큰이 존재함을 확인하고 타입 단언
7980
expect(foundToken).not.toBeNull();
80-
expect(foundToken?.token).toBe(token);
81-
expect(foundToken?.is_used).toBe(false);
82-
if (foundToken) {
83-
expect(new Date(foundToken.expires_at).getTime()).toBeGreaterThan(new Date(foundToken.created_at).getTime());
84-
}
81+
const nonNullToken = foundToken as NonNullable<typeof foundToken>;
82+
83+
expect(nonNullToken.token).toBe(token);
84+
expect(nonNullToken.is_used).toBe(false);
85+
expect(new Date(nonNullToken.expires_at).getTime()).toBeGreaterThan(new Date(nonNullToken.created_at).getTime());
8586
});
8687

8788
it('존재하지 않는 토큰 조회 시 null을 반환해야 한다', async () => {

0 commit comments

Comments
 (0)