Skip to content

Commit 20ed709

Browse files
Add integration test to check link_to_page block ✅
1 parent ad84cfd commit 20ed709

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Test/Notion.IntegrationTests/IBlocksClientTests.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,35 @@ private static IEnumerable<object[]> BlockData()
506506
Assert.Null(templateBlock.Template.Children);
507507
Assert.Equal("Test Template 2", templateBlock.Template.Text.OfType<RichTextText>().First().Text.Content);
508508
})
509+
},
510+
new object[]
511+
{
512+
new LinkToPageBlock()
513+
{
514+
LinkToPage = new PageParent
515+
{
516+
Type = ParentType.PageId,
517+
PageId = "533578e3edf14c0a91a9da6b09bac3ee"
518+
}
519+
},
520+
new LinkToPageUpdateBlock()
521+
{
522+
LinkToPage = new ParentPageInput
523+
{
524+
PageId = "3c357473a28149a488c010d2b245a589"
525+
}
526+
},
527+
new Action<IBlock>(block =>
528+
{
529+
Assert.NotNull(block);
530+
var linkToPageBlock = Assert.IsType<LinkToPageBlock>(block);
531+
532+
var pageParent = Assert.IsType<PageParent>(linkToPageBlock.LinkToPage);
533+
534+
// TODO: Currently the api doesn't allow to update the link_to_page block type
535+
// This will change to updated ID once api start to support
536+
Assert.Equal(Guid.Parse("533578e3edf14c0a91a9da6b09bac3ee"), Guid.Parse(pageParent.PageId));
537+
})
509538
}
510539
};
511540
}

0 commit comments

Comments
 (0)