Skip to content

Commit

Permalink
test: add user-storage to privacy snapshot and update user-storage mocks
Browse files Browse the repository at this point in the history
note - we need to update our library to support generic paths and mock X-Sync data features
  • Loading branch information
Prithpal-Sooriya committed Sep 19, 2024
1 parent 0fcc063 commit fcec986
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion privacy-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
"oidc.api.cx.metamask.io",
"price.api.cx.metamask.io",
"token.api.cx.metamask.io",
"client-side-detection.api.cx.metamask.io"
"client-side-detection.api.cx.metamask.io",
"user-storage.api.cx.metamask.io"
]
13 changes: 13 additions & 0 deletions test/e2e/tests/notifications/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ export async function mockNotificationServices(server: Mockttp) {
mockAPICall(server, await StorageMocks.getMockUserStorageGetResponse());
mockAPICall(server, await StorageMocks.getMockUserStoragePutResponse());

// TODO - add better mock responses for other Profile Sync features
// (Account Sync, Network Sync, ...)
server
.forGet(/https:\/\/user-storage\.api\.cx\.metamask\.io\/.*/gu)
?.thenCallback(() => ({
statusCode: 404,
}));
server
.forPut(/https:\/\/user-storage\.api\.cx\.metamask\.io\/.*/gu)
?.thenCallback(() => ({
statusCode: 204,
}));

// Notifications
mockAPICall(server, NotificationMocks.getMockFeatureAnnouncementResponse());
mockAPICall(server, NotificationMocks.getMockBatchCreateTriggersResponse());
Expand Down

0 comments on commit fcec986

Please sign in to comment.