8000 Fix broken integration tests · notion-dotnet/notion-sdk-net@a7eef15 · GitHub
[go: up one dir, main page]

Skip to content

Commit a7eef15

Browse files
Fix broken integration tests
1 parent c76c1c4 commit a7eef15

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Test/Notion.IntegrationTests/IPageClientTests.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public async Task Test_RetrievePagePropertyItemAsync()
142142

143143
var listProperty = (ListPropertyItem)property;
144144

145-
listProperty.Type.Should().BeNull();
145+
listProperty.Type.Should().NotBeNull();
146146
listProperty.Results.Should().SatisfyRespectively(p =>
147147
{
148148
p.Should().BeOfType<TitlePropertyItem>();
@@ -202,7 +202,11 @@ public async Task Test_UpdatePageProperty_with_date_as_null()
202202

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

205-
var setDate = page.Properties[datePropertyName] as DatePropertyValue;
205+
var setDate = (DatePropertyItem)await _client.Pages.RetrievePagePropertyItem(new RetrievePropertyItemParameters
206+
{
207+
PageId = page.Id,
208+
PropertyId = page.Properties[datePropertyName].Id
209+
});
206210

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

@@ -215,7 +219,11 @@ public async Task Test_UpdatePageProperty_with_date_as_null()
215219
Properties = testProps
216220
});
217221

218-
var verifyDate = updatedPage.Properties[datePropertyName] as DatePropertyValue;
222+
var verifyDate = (DatePropertyItem)await _client.Pages.RetrievePagePropertyItem(new RetrievePropertyItemParameters
223+
{
224+
PageId = page.Id,
225+
PropertyId = updatedPage.Properties[datePropertyName].Id
226+
});
219227

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

0 commit comments

Comments
 (0)
0