Skip to content

Commit

Permalink
test: fix mock current timestamp to prevent snapshot updates
Browse files Browse the repository at this point in the history
  • Loading branch information
YumoImer committed Nov 26, 2024
1 parent 98137ec commit 07c9ce7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ exports[`renders components/conversations/demo/group-sort.tsx extend context cor
class="ant-conversations-item"
>
<span
aria-label="Conversation - 08:00:00"
aria-label="Conversation1 - 00:00:00"
class="ant-typography ant-typography-ellipsis ant-conversations-label"
>
Conversation - 08:00:00
Conversation1 - 00:00:00
</span>
</li>
<div
Expand All @@ -488,18 +488,18 @@ exports[`renders components/conversations/demo/group-sort.tsx extend context cor
class="ant-tooltip-inner"
role="tooltip"
>
Conversation - 08:00:00
Conversation1 - 00:00:00
</div>
</div>
</div>
<li
class="ant-conversations-item"
>
<span
aria-label="Conversation - 08:00:03"
aria-label="Conversation2 - 00:00:03"
class="ant-typography ant-typography-ellipsis ant-conversations-label"
>
Conversation - 08:00:03
Conversation2 - 00:00:03
</span>
</li>
<div
Expand All @@ -517,18 +517,18 @@ exports[`renders components/conversations/demo/group-sort.tsx extend context cor
class="ant-tooltip-inner"
role="tooltip"
>
Conversation - 08:00:03
Conversation2 - 00:00:03
</div>
</div>
</div>
<li
class="ant-conversations-item"
>
<span
aria-label="Conversation - 08:00:07"
aria-label="Conversation3 - 00:00:07"
class="ant-typography ant-typography-ellipsis ant-conversations-label"
>
Conversation - 08:00:07
Conversation3 - 00:00:07
</span>
</li>
<div
Expand All @@ -546,18 +546,18 @@ exports[`renders components/conversations/demo/group-sort.tsx extend context cor
class="ant-tooltip-inner"
role="tooltip"
>
Conversation - 08:00:07
Conversation3 - 00:00:07
</div>
</div>
</div>
<li
class="ant-conversations-item"
>
<span
aria-label="Conversation - 08:00:10"
aria-label="Conversation4 - 00:00:10"
class="ant-typography ant-typography-ellipsis ant-conversations-label"
>
Conversation - 08:00:10
Conversation4 - 00:00:10
</span>
</li>
<div
Expand All @@ -575,7 +575,7 @@ exports[`renders components/conversations/demo/group-sort.tsx extend context cor
class="ant-tooltip-inner"
role="tooltip"
>
Conversation - 08:00:10
Conversation4 - 00:00:10
</div>
</div>
</div>
Expand Down Expand Up @@ -640,10 +640,10 @@ exports[`renders components/conversations/demo/group-sort.tsx extend context cor
class="ant-conversations-item"
>
<span
aria-label="Conversation - 08:00:14"
aria-label="Conversation5 - 23:58:48"
class="ant-typography ant-typography-ellipsis ant-conversations-label"
>
Conversation - 08:00:14
Conversation5 - 23:58:48
</span>
</li>
<div
Expand All @@ -661,18 +661,18 @@ exports[`renders components/conversations/demo/group-sort.tsx extend context cor
class="ant-tooltip-inner"
role="tooltip"
>
Conversation - 08:00:14
Conversation5 - 23:58:48
</div>
</div>
</div>
<li
class="ant-conversations-item"
>
<span
aria-label="Conversation - 08:00:18"
aria-label="Conversation6 - 23:58:51"
class="ant-typography ant-typography-ellipsis ant-conversations-label"
>
Conversation - 08:00:18
Conversation6 - 23:58:51
</span>
</li>
<div
Expand All @@ -690,7 +690,7 @@ exports[`renders components/conversations/demo/group-sort.tsx extend context cor
class="ant-tooltip-inner"
role="tooltip"
>
Conversation - 08:00:18
Conversation6 - 23:58:51
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ exports[`renders components/conversations/demo/group-sort.tsx correctly 1`] = `
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line ant-conversations-label"
>
Conversation - 08:00:00
Conversation1 - 00:00:00
</span>
</li>
<li
Expand All @@ -252,7 +252,7 @@ exports[`renders components/conversations/demo/group-sort.tsx correctly 1`] = `
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line ant-conversations-label"
>
Conversation - 08:00:03
Conversation2 - 00:00:03
</span>
</li>
<li
Expand All @@ -261,7 +261,7 @@ exports[`renders components/conversations/demo/group-sort.tsx correctly 1`] = `
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line ant-conversations-label"
>
Conversation - 08:00:07
Conversation3 - 00:00:07
</span>
</li>
<li
Expand All @@ -270,7 +270,7 @@ exports[`renders components/conversations/demo/group-sort.tsx correctly 1`] = `
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line ant-conversations-label"
>
Conversation - 08:00:10
Conversation4 - 00:00:10
</span>
</li>
</ul>
Expand Down Expand Up @@ -336,7 +336,7 @@ exports[`renders components/conversations/demo/group-sort.tsx correctly 1`] = `
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line ant-conversations-label"
>
Conversation - 08:00:14
Conversation5 - 23:58:48
</span>
</li>
<li
Expand All @@ -345,7 +345,7 @@ exports[`renders components/conversations/demo/group-sort.tsx correctly 1`] = `
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line ant-conversations-label"
>
Conversation - 08:00:18
Conversation6 - 23:58:51
</span>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions components/conversations/demo/group-sort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { type GetProp, Space, theme } from 'antd';
import React from 'react';

const items: GetProp<ConversationsProps, 'items'> = Array.from({ length: 6 }).map((_, index) => {
const timestamp = index <= 3 ? Date.now() : Date.now() - 1000 * 60 * 60 * 24 * 2;
const timestamp = index <= 3 ? 1732204800000 : 1732204800000 - 60 * 60 * 24;

return {
key: `item${index + 1}`,
label: `Conversation - ${new Date(timestamp + index * 60 * 60).toLocaleTimeString()}`,
label: `Conversation${index + 1} - ${new Date(timestamp + index * 60 * 60).toLocaleTimeString()}`,
timestamp: timestamp + index * 60,
group: index <= 3 ? 'Today' : 'Yesterday',
};
Expand Down

0 comments on commit 07c9ce7

Please sign in to comment.