mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-09 09:35:03 +09:00
Improve tests to include check for new snapshot
This commit is contained in:
parent
db7a95514d
commit
1343dad443
3 changed files with 37 additions and 37 deletions
|
@ -41,7 +41,7 @@ var (
|
|||
)
|
||||
|
||||
var (
|
||||
doSnapshot = objecttree.DoSnapshot
|
||||
DoSnapshot = objecttree.DoSnapshot
|
||||
buildHistoryTree = func(objTree objecttree.ObjectTree) (objecttree.ReadableObjectTree, error) {
|
||||
return objecttree.BuildHistoryTree(objecttree.HistoryTreeParams{
|
||||
TreeStorage: objTree.Storage(),
|
||||
|
@ -264,7 +264,7 @@ func (s *settingsObject) DeleteObject(id string) (err error) {
|
|||
err = ErrObjDoesNotExist
|
||||
return
|
||||
}
|
||||
isSnapshot := doSnapshot(s.Len())
|
||||
isSnapshot := DoSnapshot(s.Len())
|
||||
res, err := s.changeFactory.CreateObjectDeleteChange(id, s.state, isSnapshot)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
@ -146,7 +146,7 @@ func TestSettingsObject_DeleteObject_NoSnapshot(t *testing.T) {
|
|||
fx.init(t)
|
||||
|
||||
delId := "delId"
|
||||
doSnapshot = func(len int) bool {
|
||||
DoSnapshot = func(len int) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ func TestSettingsObject_DeleteObject_WithSnapshot(t *testing.T) {
|
|||
|
||||
fx.init(t)
|
||||
delId := "delId"
|
||||
doSnapshot = func(len int) bool {
|
||||
DoSnapshot = func(len int) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue