From da2330944486caf7d299d3f6639f3a39cc23a6f4 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Mon, 19 Sep 2022 08:48:43 +0200 Subject: [PATCH] Add unit test for formatWeekday util --- src/shared/dateFormatter.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/shared/dateFormatter.spec.js b/src/shared/dateFormatter.spec.js index 38849c39..c467a892 100644 --- a/src/shared/dateFormatter.spec.js +++ b/src/shared/dateFormatter.spec.js @@ -3,6 +3,7 @@ import { formatMonth, formatMonthYear, formatShortWeekday, + formatWeekday, formatYear, } from './dateFormatter'; @@ -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);