From a076a7c467e53448f0ae5e9046417915c870f9d7 Mon Sep 17 00:00:00 2001 From: Matteo Scurati Date: Mon, 14 Oct 2024 12:40:22 +0200 Subject: [PATCH] fix: :bug: use better mock data (#4791) ## Explanation This PR modifies some mock data returned by the NotificationServicesController to provide more realistic data for use in tests and component rendering in Storybook. ## References N/A ## Changelog ### `@metamask/notification-services-controller` - **CHANGED**: some functions in `mock-raw-notifications` now return more realistic mock data ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes --- .../__fixtures__/mock-raw-notifications.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/notification-services-controller/src/NotificationServicesController/__fixtures__/mock-raw-notifications.ts b/packages/notification-services-controller/src/NotificationServicesController/__fixtures__/mock-raw-notifications.ts index 57591334f7..7d41fa3e7a 100644 --- a/packages/notification-services-controller/src/NotificationServicesController/__fixtures__/mock-raw-notifications.ts +++ b/packages/notification-services-controller/src/NotificationServicesController/__fixtures__/mock-raw-notifications.ts @@ -704,7 +704,7 @@ export function createMockNotificationEnsExpiration(): OnChainRawNotification { data: { kind: 'ens_expiration', chainId: 1, - reverseEnsName: 'example.eth', + reverseEnsName: 'vitalik.eth', expirationDateIso: '2024-01-01T00:00:00Z', reminderDelayInSeconds: 86400, }, @@ -733,11 +733,11 @@ export function createMockNotificationLidoStakingRewards(): OnChainRawNotificati data: { kind: 'lido_staking_rewards', chainId: 1, - currentStethBalance: '100', - currentEthValue: '10000.00', - estimatedTotalRewardInPeriod: '10000.00', - daysSinceLastNotification: 1, - notificationIntervalDays: 1, + currentStethBalance: '10', + currentEthValue: '10.5', + estimatedTotalRewardInPeriod: '0.5', + daysSinceLastNotification: 30, + notificationIntervalDays: 30, }, id: 'd73df14d-ce73-4f38-bad3-ab028154042l', trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042l', @@ -766,7 +766,7 @@ export function createMockNotificationNotionalLoanExpiration(): OnChainRawNotifi chainId: 1, loans: [ { - amount: '100', + amount: '1.1234', symbol: 'ETH', maturityDateIso: '2024-01-01T00:00:00Z', }, @@ -798,11 +798,11 @@ export function createMockNotificationRocketpoolStakingRewards(): OnChainRawNoti data: { kind: 'rocketpool_staking_rewards', chainId: 1, - currentRethBalance: '100', - currentEthValue: '10000.00', - estimatedTotalRewardInPeriod: '10000.00', - daysSinceLastNotification: 1, - notificationIntervalDays: 1, + currentRethBalance: '10', + currentEthValue: '10.5', + estimatedTotalRewardInPeriod: '0.5', + daysSinceLastNotification: 30, + notificationIntervalDays: 30, }, id: 'd73df14d-ce73-4f38-bad3-ab028154042r', trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042r',