Skip to content
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

Feat/#353 유틸함수 테스트 보강 #356

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions frontend/src/shared/utils/formatOrdinals.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import formatOrdinals from '@/shared/utils/formatOrdinals';

describe('formatOrdinals', () => {
test('숫자 1은 1st를 반환한다.', () => {
expect(formatOrdinals(1)).toBe('1st');
});

test('숫자 2은 1nd를 반환한다.', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

테스트명에 오류가 있네요~! ㅎㅎ

expect(formatOrdinals(2)).toBe('2nd');
});

test('숫자 3은 1rd를 반환한다.', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도여~

expect(formatOrdinals(3)).toBe('3rd');
});

test('숫자 4은 4th를 반환한다.', () => {
expect(formatOrdinals(4)).toBe('4th');
});

test('숫자 11은 11th를 반환한다.', () => {
expect(formatOrdinals(11)).toBe('11th');
});
});