Skip to content

Commit 24e518e

Browse files
committed
test: fixed tests
1 parent 9261685 commit 24e518e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

app/scripts/metamask-controller.actions.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('MetaMaskController', function () {
9898

9999
beforeAll(async function () {
100100
await ganacheServer.start({ port: 32545 });
101-
});
101+
}, 30000);
102102

103103
beforeEach(function () {
104104
nock(PHISHING_CONFIG_BASE_URL)
@@ -158,7 +158,7 @@ describe('MetaMaskController', function () {
158158

159159
afterAll(async function () {
160160
await ganacheServer.quit();
161-
});
161+
}, 30000);
162162

163163
describe('Phishing Detection Mock', function () {
164164
it('should be updated to use v1 of the API', function () {

shared/lib/gator-permissions/time-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ export function convertAmountPerSecondToAmountPerPeriod(
8787
* Converts a unix timestamp(in seconds) to a human-readable date format.
8888
*
8989
* @param timestamp - The unix timestamp in seconds.
90-
* @returns The formatted date string in mm/dd/yyyy format in local timezone.
90+
* @returns The formatted date string in mm/dd/yyyy format in UTC timezone.
9191
*/
9292
export const convertTimestampToReadableDate = (timestamp: number): string => {
9393
if (timestamp === 0) {
9494
return '';
9595
}
9696

97-
const dateTime = DateTime.fromSeconds(timestamp);
97+
const dateTime = DateTime.fromSeconds(timestamp, { zone: 'utc' });
9898

9999
if (!dateTime.isValid) {
100100
throw new Error('Invalid date format');

ui/components/multichain/network-list-menu/network-list-menu.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ describe('NetworkListMenu', () => {
496496
NETWORK_TYPES.MAINNET,
497497
),
498498
);
499-
});
499+
}, 30000);
500500

501501
it('fires setNetworkClientIdForDomain when test network item is clicked', async () => {
502502
const state = {
@@ -668,6 +668,6 @@ describe('NetworkListMenu', () => {
668668
await waitFor(() => expect(mockUpdateCustomNonce).toHaveBeenCalled());
669669
await waitFor(() => expect(mockSetNextNonce).toHaveBeenCalled());
670670
await waitFor(() => expect(mockDetectNfts).toHaveBeenCalled());
671-
});
671+
}, 30000);
672672
});
673673
});

ui/components/multichain/pages/gator-permissions/components/review-gator-permission-item.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('Permission List Item', () => {
5858
const mockStartTime = 1736271776; // January 7, 2025;
5959

6060
describe('NATIVE token permissions', () => {
61-
const mockExpiryTimestamp = 1767312000; // January 1, 2026
61+
const mockExpiryTimestamp = 1767225600; // January 1, 2026
6262
const expiryHex = mockExpiryTimestamp.toString(16).padStart(32, '0');
6363
const termsHex = `0x${'0'.repeat(32)}${expiryHex}` as Hex;
6464

@@ -260,7 +260,7 @@ describe('Permission List Item', () => {
260260
const mockTokenAddress: Hex =
261261
'0x2260fac5e5542a773aa44fbcfedf7c193bc2c599';
262262

263-
const mockExpiryTimestamp = 1767312000; // January 1, 2026
263+
const mockExpiryTimestamp = 1767225600; // January 1, 2026
264264
const expiryHex = mockExpiryTimestamp.toString(16).padStart(32, '0');
265265
const termsHex = `0x${'0'.repeat(32)}${expiryHex}` as Hex;
266266

0 commit comments

Comments
 (0)