@@ -154,20 +154,20 @@ describe("addYears", () => {
154
154
describe ( "getFormattedDate" , ( ) => {
155
155
it ( "returns the formatted date string using the default options" , ( ) => {
156
156
const date = new Date ( 2023 , 0 , 15 ) ; // January 15th, 2023
157
- const formattedDate = getFormattedDate ( "en" , date ) ;
157
+ const formattedDate = getFormattedDate ( "en" , date , 'dd-MMM-yyyy' ) ;
158
158
expect ( formattedDate ) . toBe ( "January 15, 2023" ) ;
159
159
} ) ;
160
160
161
161
it ( "returns the formatted date string using the specified options" , ( ) => {
162
162
const date = new Date ( 2023 , 0 , 15 ) ; // January 15th, 2023
163
163
const options : Intl . DateTimeFormatOptions = { month : "short" , year : "numeric" } ;
164
- const formattedDate = getFormattedDate ( "en" , date , options ) ;
164
+ const formattedDate = getFormattedDate ( "en" , date , 'dd-MMM-yyyy' , options ) ;
165
165
expect ( formattedDate ) . toBe ( "Jan 2023" ) ;
166
166
} ) ;
167
167
168
168
it ( "returns the formatted date string using the specified language" , ( ) => {
169
169
const date = new Date ( 2023 , 0 , 15 ) ; // January 15th, 2023
170
- const formattedDate = getFormattedDate ( "pt-BR" , date ) ;
170
+ const formattedDate = getFormattedDate ( "pt-BR" , date , 'dd-MMM-yyyy' ) ;
171
171
expect ( formattedDate ) . toBe ( "15 de janeiro de 2023" ) ;
172
172
} ) ;
173
173
} ) ;
0 commit comments