@@ -52,8 +52,8 @@ describe('designated survival', function () {
52
52
expect ( vault . sharing . designatedSurvivor ) . to . equal ( contactContext . userUuid )
53
53
} )
54
54
55
- describe . skip ( 'owner of a shared vault with a designated survivor removing the vault' , ( ) => {
56
- it ( 'should not remove all users from the vault upon shared vault removal' , async ( ) => {
55
+ describe ( 'owner of a shared vault with a designated survivor removing the vault' , ( ) => {
56
+ it ( 'should remove all users from the vault upon shared vault removal' , async ( ) => {
57
57
const { sharedVault, contactContext } =
58
58
await Collaboration . createSharedVaultWithAcceptedInvite ( context )
59
59
secondContext = contactContext
@@ -74,23 +74,20 @@ describe('designated survival', function () {
74
74
await secondContext . syncAndAwaitNotificationsProcessing ( )
75
75
await thirdContext . syncAndAwaitNotificationsProcessing ( )
76
76
77
- const sharedVaultUsers = await secondContext . vaultUsers . getSharedVaultUsersFromServer ( sharedVault )
78
- expect ( sharedVaultUsers . length ) . to . equal ( 2 )
79
-
80
77
expect ( context . vaults . getVault ( { keySystemIdentifier : sharedVault . systemIdentifier } ) . isFailed ( ) ) . to . be . true
81
78
expect ( context . keys . getPrimaryKeySystemRootKey ( sharedVault . systemIdentifier ) ) . to . be . undefined
82
79
expect ( context . keys . getKeySystemItemsKeys ( sharedVault . systemIdentifier ) ) . to . be . empty
83
80
84
- expect ( secondContext . vaults . getVault ( { keySystemIdentifier : sharedVault . systemIdentifier } ) . getValue ( ) ) . to . not . be . undefined
85
- expect ( secondContext . keys . getPrimaryKeySystemRootKey ( sharedVault . systemIdentifier ) ) . to . not . be . undefined
86
- expect ( secondContext . keys . getKeySystemItemsKeys ( sharedVault . systemIdentifier ) ) . to . not . be . empty
81
+ expect ( secondContext . vaults . getVault ( { keySystemIdentifier : sharedVault . systemIdentifier } ) . isFailed ( ) ) . to . be . true
82
+ expect ( secondContext . keys . getPrimaryKeySystemRootKey ( sharedVault . systemIdentifier ) ) . to . be . undefined
83
+ expect ( secondContext . keys . getKeySystemItemsKeys ( sharedVault . systemIdentifier ) ) . to . be . empty
87
84
88
- expect ( thirdContext . vaults . getVault ( { keySystemIdentifier : sharedVault . systemIdentifier } ) . getValue ( ) ) . to . not . be . undefined
89
- expect ( thirdContext . keys . getPrimaryKeySystemRootKey ( sharedVault . systemIdentifier ) ) . to . not . be . undefined
90
- expect ( thirdContext . keys . getKeySystemItemsKeys ( sharedVault . systemIdentifier ) ) . to . not . be . empty
85
+ expect ( thirdContext . vaults . getVault ( { keySystemIdentifier : sharedVault . systemIdentifier } ) . isFailed ( ) ) . to . be . true
86
+ expect ( thirdContext . keys . getPrimaryKeySystemRootKey ( sharedVault . systemIdentifier ) ) . to . be . undefined
87
+ expect ( thirdContext . keys . getKeySystemItemsKeys ( sharedVault . systemIdentifier ) ) . to . be . empty
91
88
} )
92
89
93
- it ( 'should transition items of the owner in the vault to the designated survivor' , async ( ) => {
90
+ it ( 'should not transition items of the owner in the vault to the designated survivor' , async ( ) => {
94
91
const { sharedVault, contactContext } =
95
92
await Collaboration . createSharedVaultWithAcceptedInvite ( context )
96
93
secondContext = contactContext
@@ -113,19 +110,14 @@ describe('designated survival', function () {
113
110
await secondContext . syncAndAwaitNotificationsProcessing ( )
114
111
await thirdContext . syncAndAwaitNotificationsProcessing ( )
115
112
116
- const sharedVaultUsers = await secondContext . vaultUsers . getSharedVaultUsersFromServer ( sharedVault )
117
- expect ( sharedVaultUsers . length ) . to . equal ( 2 )
118
-
119
113
const contactNote = secondContext . items . findItem ( note . uuid )
120
- expect ( contactNote . key_system_identifier ) . to . equal ( sharedVault . systemIdentifier )
121
- expect ( contactNote . user_uuid ) . to . equal ( secondContext . userUuid )
114
+ expect ( contactNote ) . to . be . undefined
122
115
123
116
const thirdPartyNote = thirdContext . items . findItem ( note . uuid )
124
- expect ( thirdPartyNote . key_system_identifier ) . to . equal ( sharedVault . systemIdentifier )
125
- expect ( thirdPartyNote . user_uuid ) . to . equal ( secondContext . userUuid )
117
+ expect ( thirdPartyNote ) . to . be . undefined
126
118
} )
127
119
128
- it ( 'should still allow to download files of the owner in the vault' , async ( ) => {
120
+ it ( 'should not allow to download files of the owner in the vault' , async ( ) => {
129
121
await context . activatePaidSubscriptionForUser ( )
130
122
131
123
const { sharedVault, contactContext } =
@@ -157,14 +149,10 @@ describe('designated survival', function () {
157
149
await secondContext . syncAndAwaitNotificationsProcessing ( )
158
150
159
151
const sharedFileAfter = secondContext . items . findItem ( uploadedFile . uuid )
160
- expect ( sharedFileAfter ) . to . not . be . undefined
161
- expect ( sharedFileAfter . remoteIdentifier ) . to . equal ( uploadedFile . remoteIdentifier )
162
-
163
- const downloadedBytes = await Files . downloadFile ( secondContext . files , sharedFileAfter )
164
- expect ( downloadedBytes ) . to . eql ( buffer )
152
+ expect ( sharedFileAfter ) . to . be . undefined
165
153
} )
166
154
167
- it ( 'should transition vault ownership to the designated survivor' , async ( ) => {
155
+ it ( 'should not transition vault ownership to the designated survivor' , async ( ) => {
168
156
const { sharedVault, contactContext } =
169
157
await Collaboration . createSharedVaultWithAcceptedInvite ( context )
170
158
secondContext = contactContext
@@ -184,13 +172,11 @@ describe('designated survival', function () {
184
172
await secondContext . syncAndAwaitNotificationsProcessing ( )
185
173
await thirdContext . syncAndAwaitNotificationsProcessing ( )
186
174
187
- const contactVault = secondContext . vaults . getVault ( { keySystemIdentifier : sharedVault . systemIdentifier } ) . getValue ( )
188
- expect ( contactVault . sharing . ownerUserUuid ) . to . not . equal ( context . userUuid )
189
- expect ( contactVault . sharing . ownerUserUuid ) . to . equal ( secondContext . userUuid )
175
+ const contactVaultOrError = secondContext . vaults . getVault ( { keySystemIdentifier : sharedVault . systemIdentifier } )
176
+ expect ( contactVaultOrError . isFailed ( ) ) . to . be . true
190
177
191
- const thirdPartyVault = thirdContext . vaults . getVault ( { keySystemIdentifier : sharedVault . systemIdentifier } ) . getValue ( )
192
- expect ( thirdPartyVault . sharing . ownerUserUuid ) . to . not . equal ( context . userUuid )
193
- expect ( thirdPartyVault . sharing . ownerUserUuid ) . to . equal ( secondContext . userUuid )
178
+ const thirdPartyVaultOrError = thirdContext . vaults . getVault ( { keySystemIdentifier : sharedVault . systemIdentifier } )
179
+ expect ( thirdPartyVaultOrError . isFailed ( ) ) . to . be . true
194
180
} )
195
181
} )
196
182
0 commit comments