Skip to content

Commit

Permalink
Merge pull request #306 from notion-dotnet/258-fix-breaking-integrati…
Browse files Browse the repository at this point in the history
…on-tests

Fix breaking integration tests
  • Loading branch information
KoditkarVedant authored Aug 20, 2022
2 parents d335c71 + f044e58 commit f2901a8
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions Test/Notion.IntegrationTests/IPageClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ public async Task CreateAsync_CreatesANewPage()
.DatabaseId.Should().Be(_databaseId);

page.Properties.Should().ContainKey("Name");
page.Properties["Name"].Should().BeOfType<TitlePropertyValue>().Which
.Title.First().PlainText.Should().Be("Test Page Title");
var pageProperty = page.Properties["Name"].Should().BeOfType<PagePropertyOnId>().Subject;

var titleProperty = (ListPropertyItem)await _client.Pages.RetrievePagePropertyItem(new RetrievePropertyItemParameters
{
PageId = page.Id,
PropertyId = pageProperty.Id
});

titleProperty.Results.First().As<TitlePropertyItem>().Title.PlainText.Should().Be("Test Page Title");

await _client.Pages.UpdateAsync(page.Id, new PagesUpdateParameters
{
Expand Down Expand Up @@ -98,8 +105,15 @@ public async Task Bug_unable_to_create_page_with_select_property()
.DatabaseId.Should().Be(_databaseId);

page.Properties.Should().ContainKey("Name");
page.Properties["Name"].Should().BeOfType<TitlePropertyValue>().Which
.Title.First().PlainText.Should().Be("Test Page Title");
var pageProperty = page.Properties["Name"].Should().BeOfType<PagePropertyOnId>().Subject;

var titleProperty = (ListPropertyItem)await _client.Pages.RetrievePagePropertyItem(new RetrievePropertyItemParameters
{
PageId = page.Id,
PropertyId = pageProperty.Id
});

titleProperty.Results.First().As<TitlePropertyItem>().Title.PlainText.Should().Be("Test Page Title");

await _client.Pages.UpdateAsync(page.Id, new PagesUpdateParameters
{
Expand Down

0 comments on commit f2901a8

Please sign in to comment.