Skip to content

Commit

Permalink
#255 Add collections to space tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamZ-Kontent committed Jan 18, 2024
1 parent eec8790 commit 7f4f52f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
"name": "New space name",
"web_spotlight_root_item": {
"id": "1024356f-858f-421a-b804-07c6bfe10ce5"
}
},
"collections": [
{ "id": "b38269bf-873c-4021-99ee-e63c7850a505" },
{ "id": "d884b892-4aef-4cd0-8910-68887f69d280" }
]
}
6 changes: 5 additions & 1 deletion Kontent.Ai.Management.Tests/Data/Space/Space.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
"name": "Space 1",
"web_spotlight_root_item": {
"id": "1024356f-858f-421a-b804-07c6bfe10ce5"
}
},
"collections": [
{ "id": "cfa0dbac-436f-4e15-865b-6a1795523e80" },
{ "id": "d884b892-4aef-4cd0-8910-68887f69d280" }
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public async void CreateSpace_CreatesSpace()
var createModel = new SpaceCreateModel {
Codename = expected.Codename,
Name = expected.Name,
WebSpotlightRootItem = expected.WebSpotlightRootItem
WebSpotlightRootItem = expected.WebSpotlightRootItem,
Collections = expected.Collections
};

var response = await client.CreateSpaceAsync(createModel);
Expand Down Expand Up @@ -105,7 +106,11 @@ public async void ModifySpace_Replace_ModifiesSpace()
{
new() { PropertyName = PropertyName.Name, Value = "New space name" },
new() { PropertyName = PropertyName.Codename, Value = "new_space_codename" },
new() { PropertyName = PropertyName.WebSpotlightRootItem, Value = identifier }
new() { PropertyName = PropertyName.WebSpotlightRootItem, Value = identifier },
new() { PropertyName = PropertyName.Collections, Value = new[] {
Reference.ByCodename("collection_codename"),
Reference.ById(Guid.NewGuid()) }
}
};

var response = await client.ModifySpaceAsync(identifier, changes);
Expand Down

0 comments on commit 7f4f52f

Please sign in to comment.