Skip to content

Commit

Permalink
Add unit test for formatWeekday util
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Sep 19, 2022
1 parent a5e778a commit da23309
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/shared/dateFormatter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
formatMonth,
formatMonthYear,
formatShortWeekday,
formatWeekday,
formatYear,
} from './dateFormatter';

Expand Down Expand Up @@ -46,6 +47,16 @@ describe('formatShortWeekday', () => {
});
});

describe('formatWeekday', () => {
it('returns proper weekday name', () => {
const date = new Date(2017, 1, 1);

const formattedDate = formatWeekday('en-US', date);

expect(formattedDate).toBe('Wednesday');
});
});

describe('formatYear', () => {
it('returns proper month name and year', () => {
const date = new Date(2017, 1, 1);
Expand Down

0 comments on commit da23309

Please sign in to comment.