From e8aa473223e4675b58ef0dc98ce9685bc42bf441 Mon Sep 17 00:00:00 2001 From: Andrew Sisley Date: Thu, 7 Sep 2023 14:29:22 -0400 Subject: [PATCH] Remove collection update simple save test This test now already exist in the mutation directory --- .../collection/update/simple/save_test.go | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 tests/integration/collection/update/simple/save_test.go diff --git a/tests/integration/collection/update/simple/save_test.go b/tests/integration/collection/update/simple/save_test.go deleted file mode 100644 index 1174af4028..0000000000 --- a/tests/integration/collection/update/simple/save_test.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Democratized Data Foundation -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -package update - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/sourcenetwork/defradb/client" - testUtils "github.com/sourcenetwork/defradb/tests/integration/collection" -) - -func TestUpdateSaveErrorsGivenUnknownField(t *testing.T) { - doc, err := client.NewDocFromJSON( - []byte( - `{ - "name": "John", - "age": 21 - }`, - ), - ) - if err != nil { - assert.Fail(t, err.Error()) - } - - err = doc.SetWithJSON( - []byte( - `{ - "FieldDoesNotExist": 21 - }`, - ), - ) - if err != nil { - assert.Fail(t, err.Error()) - } - - test := testUtils.TestCase{ - Docs: map[string][]string{ - "Users": { - `{ - "name": "John", - "age": 21 - }`, - }, - }, - CollectionCalls: map[string][]func(client.Collection) error{ - "Users": []func(c client.Collection) error{ - func(c client.Collection) error { - return c.Save(context.Background(), doc) - }, - }, - }, - ExpectedError: "The given field does not exist", - } - - executeTestCase(t, test) -}