Skip to content

Commit

Permalink
chore: fix some lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathansoufer committed May 30, 2024
1 parent c0290df commit 9579bab
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ import { MOCK_ACCESS_TOKEN } from '@metamask/profile-sync-controller';
import type {
AuthenticationControllerGetBearerToken,
AuthenticationControllerIsSignedIn,
UserStorageControllerGetStorageKey,
UserStorageControllerPerformGetStorage,
UserStorageControllerPerformSetStorage,
UserStorageControllerEnableProfileSyncing,
} from '@metamask/profile-sync-controller';
import type {
PushPlatformNotificationsControllerEnablePushNotifications,
PushPlatformNotificationsControllerDisablePushNotifications,
PushPlatformNotificationsControllerUpdateTriggerPushNotifications,
} from '@metamask/push-platform-notifications-controller';
import type {
UserStorageControllerGetStorageKey,
UserStorageControllerPerformGetStorage,
UserStorageControllerPerformSetStorage,
UserStorageControllerEnableProfileSyncing,
} from '@metamask/profile-sync-controller';

import type {
AllowedActions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Feature Announcement Notifications', () => {

const notifications = await getFeatureAnnouncementNotifications();
mockEndpoint.done();
expect(notifications).toEqual([]);
expect(notifications).toStrictEqual([]);
});

it('should return an empty array if data is not available', async () => {
Expand All @@ -34,7 +34,7 @@ describe('Feature Announcement Notifications', () => {

const notifications = await getFeatureAnnouncementNotifications();
mockEndpoint.done();
expect(notifications).toEqual([]);
expect(notifications).toStrictEqual([]);
});

it('should fetch entries from Contentful and return formatted notifications', async () => {
Expand All @@ -48,7 +48,7 @@ describe('Feature Announcement Notifications', () => {
mockEndpoint.done();

const resultNotification = notifications[0];
expect(resultNotification).toEqual(
expect(resultNotification).toStrictEqual(
expect.objectContaining({
id: 'dont-miss-out-on-airdrops-and-new-nft-mints',
type: TRIGGER_TYPES.FEATURES_ANNOUNCEMENT,
Expand Down
10 changes: 5 additions & 5 deletions packages/notifications-controller/src/utils/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('metamask-notifications/utils - checkAccountsPresence()', () => {
const result = MetamaskNotificationsUtils.checkAccountsPresence(storage, [
MOCK_USER_STORAGE_ACCOUNT,
]);
expect(result).toEqual({
expect(result).toStrictEqual({
[MOCK_USER_STORAGE_ACCOUNT.toLowerCase()]: true,
});
});
Expand All @@ -96,7 +96,7 @@ describe('metamask-notifications/utils - checkAccountsPresence()', () => {
MOCK_USER_STORAGE_ACCOUNT,
MOCK_MISSING_ADDRESS,
]);
expect(result).toEqual({
expect(result).toStrictEqual({
[MOCK_USER_STORAGE_ACCOUNT.toLowerCase()]: true,
[MOCK_MISSING_ADDRESS.toLowerCase()]: false,
});
Expand All @@ -109,7 +109,7 @@ describe('metamask-notifications/utils - checkAccountsPresence()', () => {
const result = MetamaskNotificationsUtils.checkAccountsPresence(storage, [
MOCK_USER_STORAGE_ACCOUNT,
]);
expect(result).toEqual({
expect(result).toStrictEqual({
[MOCK_USER_STORAGE_ACCOUNT.toLowerCase()]: false, // false due to missing chains
});
});
Expand All @@ -126,7 +126,7 @@ describe('metamask-notifications/utils - checkAccountsPresence()', () => {
const result = MetamaskNotificationsUtils.checkAccountsPresence(storage, [
MOCK_USER_STORAGE_ACCOUNT,
]);
expect(result).toEqual({
expect(result).toStrictEqual({
[MOCK_USER_STORAGE_ACCOUNT.toLowerCase()]: false, // false due to missing triggers
});
});
Expand Down Expand Up @@ -192,7 +192,7 @@ describe('metamask-notifications/utils - getUUIDsForKinds()', () => {
const result = MetamaskNotificationsUtils.getUUIDsForKinds(partialStorage, [
TRIGGER_TYPES.ERC1155_RECEIVED,
]);
expect(result).toEqual(['t1']);
expect(result).toStrictEqual(['t1']);
});

it('returns empty list if no triggers are found matching the kinds', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ describe('authentication/authentication-controller - performSignIn() tests', ()
mockEndpoints.mockAccessTokenEndpoint.isDone(),
];
if (endpointFail === 'nonce') {
expect(endpointsCalled).toEqual([true, false, false]);
expect(endpointsCalled).toStrictEqual([true, false, false]);
}

if (endpointFail === 'login') {
expect(endpointsCalled).toEqual([true, true, false]);
expect(endpointsCalled).toStrictEqual([true, true, false]);
}

if (endpointFail === 'token') {
expect(endpointsCalled).toEqual([true, true, true]);
expect(endpointsCalled).toStrictEqual([true, true, true]);
}
}
});
Expand Down Expand Up @@ -226,7 +226,7 @@ describe('authentication/authentication-controller - getSessionProfile() tests',

const result = await controller.getSessionProfile();
expect(result).toBeDefined();
expect(result).toEqual(originalState.sessionData?.profile);
expect(result).toStrictEqual(originalState.sessionData?.profile);
});

it('should return new access token if state is invalid', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ describe('PushPlatformNotificationsServices', () => {
MOCK_TRIGGERS,
);

expect(res).toEqual({
expect(res).toStrictEqual({
isTriggersLinkedToPushNotifications: true,
fcmToken: 'fcm-token',
});
Expand All @@ -207,7 +207,7 @@ describe('PushPlatformNotificationsServices', () => {
MOCK_TRIGGERS,
);

expect(res).toEqual({
expect(res).toStrictEqual({
isTriggersLinkedToPushNotifications: false,
fcmToken: undefined,
});
Expand Down

0 comments on commit 9579bab

Please sign in to comment.