forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[explorer] Displays Transaction Timestamps (MystenLabs#2630)
* displays timestamp as a number in the Tx Results and to Tx tables in Object and Address Results
- Loading branch information
Showing
16 changed files
with
517 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { timeAgo } from '../utils/timeUtils'; | ||
|
||
const timeNow = 1735693990000; | ||
|
||
describe('Unit Tests', () => { | ||
describe('timeAgo', () => { | ||
it('handles days', () => { | ||
expect(timeAgo(1734220800000, timeNow)).toEqual('17 days 1 hour'); | ||
}); | ||
it('handles hours', () => { | ||
expect(timeAgo(1735610580000, timeNow)).toEqual('23 hours 10 mins'); | ||
}); | ||
it('handles minutes', () => { | ||
expect(timeAgo(1735693930000, timeNow)).toEqual('1 min'); | ||
}); | ||
it('handles seconds', () => { | ||
expect(timeAgo(1735693987000, timeNow)).toEqual('3 secs'); | ||
}); | ||
it('handles milliseconds', () => { | ||
expect(timeAgo(1735693989100, timeNow)).toEqual('< 1 sec'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import '@testing-library/jest-dom'; | ||
|
||
jest.setTimeout(100000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.