File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
src/components/DateSeparator Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const UnMemoizedDateSeparator = (props: DateSeparatorProps) => {
3939 < hr className = 'str-chat__date-separator-line' />
4040 ) }
4141 < div className = 'str-chat__date-separator-date' >
42- { unread ? t ( 'New' ) : formattedDate }
42+ { unread ? ` ${ t ( 'New' ) } - ${ formattedDate } ` : formattedDate }
4343 </ div >
4444 { ( position === 'left' || position === 'center' ) && (
4545 < hr className = 'str-chat__date-separator-line' />
Original file line number Diff line number Diff line change @@ -12,9 +12,7 @@ Dayjs.extend(calendar);
1212
1313afterEach ( cleanup ) ; // eslint-disable-line
1414
15- // this changes every time tests are run,
16- // but by mocking the actual renderers tests are still deterministic
17- const now = new Date ( ) ;
15+ const now = new Date ( '2020-03-30T22:57:47.173Z' ) ;
1816
1917const withContext = ( props ) => {
2018 const t = jest . fn ( ( key ) => key ) ;
@@ -41,7 +39,7 @@ describe('DateSeparator', () => {
4139 const { Component, t } = withContext ( { date : now , unread : true } ) ;
4240 const { queryByText } = render ( Component ) ;
4341
44- expect ( queryByText ( 'New' ) ) . toBeInTheDocument ( ) ;
42+ expect ( queryByText ( 'New - 03/30/2020 ' ) ) . toBeInTheDocument ( ) ;
4543 expect ( t ) . toHaveBeenCalledWith ( 'New' ) ;
4644 } ) ;
4745
@@ -58,7 +56,7 @@ describe('DateSeparator', () => {
5856 <div
5957 className="str-chat__date-separator-date"
6058 >
61- New
59+ New - 03/30/2020
6260 </div>
6361 </div>
6462 ` ) ;
You can’t perform that action at this time.
0 commit comments