Skip to content

Commit da23309

Browse files
committed
Add unit test for formatWeekday util
1 parent a5e778a commit da23309

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/shared/dateFormatter.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
formatMonth,
44
formatMonthYear,
55
formatShortWeekday,
6+
formatWeekday,
67
formatYear,
78
} from './dateFormatter';
89

@@ -46,6 +47,16 @@ describe('formatShortWeekday', () => {
4647
});
4748
});
4849

50+
describe('formatWeekday', () => {
51+
it('returns proper weekday name', () => {
52+
const date = new Date(2017, 1, 1);
53+
54+
const formattedDate = formatWeekday('en-US', date);
55+
56+
expect(formattedDate).toBe('Wednesday');
57+
});
58+
});
59+
4960
describe('formatYear', () => {
5061
it('returns proper month name and year', () => {
5162
const date = new Date(2017, 1, 1);

0 commit comments

Comments
 (0)