Browse Source

fix(syncing-server): specs

Karol Sójko 1 year ago
parent
commit
94467747ac

+ 11 - 2
packages/syncing-server/src/Domain/Notifications/Notification.spec.ts

@@ -1,11 +1,20 @@
-import { NotificationPayload, NotificationType, Timestamps, Uuid } from '@standardnotes/domain-core'
+import {
+  NotificationPayload,
+  NotificationPayloadIdentifierType,
+  NotificationType,
+  Timestamps,
+  Uuid,
+} from '@standardnotes/domain-core'
 
 import { Notification } from './Notification'
 
 describe('Notification', () => {
   it('should create an entity', () => {
     const payload = NotificationPayload.create({
-      sharedVaultUuid: Uuid.create('0e8c3c7e-3f1a-4f7a-9b5a-5b2b0a7d4b1e').getValue(),
+      primaryIdentifier: Uuid.create('0e8c3c7e-3f1a-4f7a-9b5a-5b2b0a7d4b1e').getValue(),
+      primaryIndentifierType: NotificationPayloadIdentifierType.create(
+        NotificationPayloadIdentifierType.TYPES.SharedVaultUuid,
+      ).getValue(),
       type: NotificationType.create(NotificationType.TYPES.SelfRemovedFromSharedVault).getValue(),
       version: '1.0',
     }).getValue()

+ 11 - 2
packages/syncing-server/src/Domain/UseCase/Messaging/AddNotificationForUser/AddNotificationForUser.spec.ts

@@ -1,5 +1,11 @@
 import { TimerInterface } from '@standardnotes/time'
-import { NotificationPayload, NotificationType, Result, Uuid } from '@standardnotes/domain-core'
+import {
+  NotificationPayload,
+  NotificationPayloadIdentifierType,
+  NotificationType,
+  Result,
+  Uuid,
+} from '@standardnotes/domain-core'
 
 import { NotificationRepositoryInterface } from '../../../Notifications/NotificationRepositoryInterface'
 import { Notification } from '../../../Notifications/Notification'
@@ -28,7 +34,10 @@ describe('AddNotificationForUser', () => {
     timer.getTimestampInMicroseconds = jest.fn().mockReturnValue(123456789)
 
     payload = NotificationPayload.create({
-      sharedVaultUuid: Uuid.create('0e8c3c7e-3f1a-4f7a-9b5a-5b2b0a7d4b1e').getValue(),
+      primaryIdentifier: Uuid.create('0e8c3c7e-3f1a-4f7a-9b5a-5b2b0a7d4b1e').getValue(),
+      primaryIndentifierType: NotificationPayloadIdentifierType.create(
+        NotificationPayloadIdentifierType.TYPES.SharedVaultUuid,
+      ).getValue(),
       type: NotificationType.create(NotificationType.TYPES.SelfRemovedFromSharedVault).getValue(),
       version: '1.0',
     }).getValue()