From 6a8415f35ce2b12aaeaedce0b1c2eab81c1513fa Mon Sep 17 00:00:00 2001 From: Andrew Sisley Date: Thu, 14 Sep 2023 09:27:53 -0400 Subject: [PATCH] WIP --- .../one_to_many/with_alias_test.go | 52 ++----------------- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/tests/integration/mutation/update/field_kinds/one_to_many/with_alias_test.go b/tests/integration/mutation/update/field_kinds/one_to_many/with_alias_test.go index d1ceb342d7..b3d28642ee 100644 --- a/tests/integration/mutation/update/field_kinds/one_to_many/with_alias_test.go +++ b/tests/integration/mutation/update/field_kinds/one_to_many/with_alias_test.go @@ -135,7 +135,7 @@ func TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_GQL( test := testUtils.TestCase{ Description: "One to many update mutation using relation alias name from many side", // This restiction is temporary due to a bug in the collection api, see - // TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_CollectionNamed + // TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_Collection // and https://github.com/sourcenetwork/defradb/issues/1703 for more info. SupportedMutationTypes: immutable.Some([]testUtils.MutationType{ testUtils.GQLRequestMutationType, @@ -211,7 +211,7 @@ func TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_GQL( // This test also documents a bug in the collection api, see: // TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_GQL // and https://github.com/sourcenetwork/defradb/issues/1703 for more info. -func TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_CollectionSave(t *testing.T) { +func TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_Collection(t *testing.T) { author1Key := "bae-2edb7fdd-cad7-5ad4-9c7d-6920245a96ed" invalidAuthorKey := "bae-35953ca-518d-9e6b-9ce6cd00eff5" @@ -219,48 +219,6 @@ func TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_Coll Description: "One to many update mutation using relation alias name from many side", SupportedMutationTypes: immutable.Some([]testUtils.MutationType{ testUtils.CollectionSaveMutationType, - }), - Actions: []any{ - testUtils.CreateDoc{ - CollectionID: 1, - Doc: `{ - "name": "John Grisham" - }`, - }, - testUtils.CreateDoc{ - CollectionID: 0, - Doc: fmt.Sprintf( - `{ - "name": "Painted House", - "author": "%s" - }`, - author1Key, - ), - }, - testUtils.UpdateDoc{ - CollectionID: 0, - DocID: 0, - Doc: fmt.Sprintf( - `{ - "author": "%s" - }`, - invalidAuthorKey, - ), - ExpectedError: "The given field does not exist. Name: author", - }, - }, - } - - executeTestCase(t, test) -} - -func TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_CollectionNamed(t *testing.T) { - author1Key := "bae-2edb7fdd-cad7-5ad4-9c7d-6920245a96ed" - invalidAuthorKey := "bae-35953ca-518d-9e6b-9ce6cd00eff5" - - test := testUtils.TestCase{ - Description: "One to many update mutation using relation alias name from many side", - SupportedMutationTypes: immutable.Some([]testUtils.MutationType{ testUtils.CollectionNamedMutationType, }), Actions: []any{ @@ -289,7 +247,7 @@ func TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_Coll }`, invalidAuthorKey, ), - ExpectedError: "no document for the given key exists", + ExpectedError: "The given field does not exist. Name: author", }, }, } @@ -304,7 +262,7 @@ func TestMutationUpdateOneToMany_AliasRelationNameToLinkFromManySideWithWrongFie test := testUtils.TestCase{ Description: "One to many update mutation using relation alias name from many side, with a wrong field.", // This restiction is temporary due to a bug in the collection api, see - // TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_CollectionNamed + // TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_Collection // and https://github.com/sourcenetwork/defradb/issues/1703 for more info. SupportedMutationTypes: immutable.Some([]testUtils.MutationType{ testUtils.GQLRequestMutationType, @@ -357,7 +315,7 @@ func TestMutationUpdateOneToMany_AliasRelationNameToLinkFromManySide(t *testing. test := testUtils.TestCase{ Description: "One to many update mutation using relation alias name from many side", // This restiction is temporary due to a bug in the collection api, see - // TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_CollectionNamed + // TestMutationUpdateOneToMany_InvalidAliasRelationNameToLinkFromManySide_Collection // and https://github.com/sourcenetwork/defradb/issues/1703 for more info. SupportedMutationTypes: immutable.Some([]testUtils.MutationType{ testUtils.GQLRequestMutationType,