Skip to content

Commit

Permalink
Fix broken integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KoditkarVedant committed Aug 20, 2022
1 parent c76c1c4 commit a7eef15
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Test/Notion.IntegrationTests/IPageClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public async Task Test_RetrievePagePropertyItemAsync()

var listProperty = (ListPropertyItem)property;

listProperty.Type.Should().BeNull();
listProperty.Type.Should().NotBeNull();
listProperty.Results.Should().SatisfyRespectively(p =>
{
p.Should().BeOfType<TitlePropertyItem>();
Expand Down Expand Up @@ -202,7 +202,11 @@ public async Task Test_UpdatePageProperty_with_date_as_null()

var page = await _client.Pages.CreateAsync(pagesCreateParameters);

var setDate = page.Properties[datePropertyName] as DatePropertyValue;
var setDate = (DatePropertyItem)await _client.Pages.RetrievePagePropertyItem(new RetrievePropertyItemParameters
{
PageId = page.Id,
PropertyId = page.Properties[datePropertyName].Id
});

setDate?.Date?.Start.Should().Be(Convert.ToDateTime("2020-12-08T12:00:00Z"));

Expand All @@ -215,7 +219,11 @@ public async Task Test_UpdatePageProperty_with_date_as_null()
Properties = testProps
});

var verifyDate = updatedPage.Properties[datePropertyName] as DatePropertyValue;
var verifyDate = (DatePropertyItem)await _client.Pages.RetrievePagePropertyItem(new RetrievePropertyItemParameters
{
PageId = page.Id,
PropertyId = updatedPage.Properties[datePropertyName].Id
});

verifyDate?.Date.Should().BeNull();

Expand Down

0 comments on commit a7eef15

Please sign in to comment.