mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
Prevent deletion for derived
This commit is contained in:
parent
3608a6949f
commit
61bd9aae1e
6 changed files with 91 additions and 18 deletions
|
@ -193,6 +193,19 @@ func TestObjectTree(t *testing.T) {
|
|||
require.Equal(t, ErrDerived, err)
|
||||
})
|
||||
|
||||
t.Run("derived root returns true", func(t *testing.T) {
|
||||
root, err := DeriveObjectTreeRoot(ObjectTreeDerivePayload{
|
||||
ChangeType: "changeType",
|
||||
ChangePayload: nil,
|
||||
SpaceId: "spaceId",
|
||||
IsEncrypted: true,
|
||||
}, aclList)
|
||||
require.NoError(t, err)
|
||||
isDerived, err := IsDerivedRoot(root)
|
||||
require.NoError(t, err)
|
||||
require.True(t, isDerived)
|
||||
})
|
||||
|
||||
t.Run("derived more than 1 change, not snapshot, correct", func(t *testing.T) {
|
||||
root, err := DeriveObjectTreeRoot(ObjectTreeDerivePayload{
|
||||
ChangeType: "changeType",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue