File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Test/Notion.IntegrationTests Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -54,5 +54,57 @@ public async Task CreateAsync_CreatesANewPage()
5454 Archived = true
5555 } ) ;
5656 }
57+
58+ [ Fact ]
59+ public async Task Bug_unable_to_create_page_with_select_property ( )
60+ {
61+ var options = new ClientOptions
62+ {
63+ AuthToken = Environment . GetEnvironmentVariable ( "NOTION_AUTH_TOKEN" )
64+ } ;
65+
66+ INotionClient _client = new NotionClient ( options ) ;
67+
68+ PagesCreateParameters pagesCreateParameters = PagesCreateParametersBuilder . Create ( new DatabaseParentInput
69+ {
70+ DatabaseId = "f86f2262-0751-40f2-8f63-e3f7a3c39fcb"
71+ } )
72+ . AddProperty ( "Name" , new TitlePropertyValue
73+ {
74+ Title = new List < RichTextBase >
75+ {
76+ new RichTextText
77+ {
78+ Text = new Text
79+ {
80+ Content = "Test Page Title"
81+ }
82+ }
83+ }
84+ } )
85+ . AddProperty ( "TestSelect" , new SelectPropertyValue
86+ {
87+ Select = new SelectOption
88+ {
89+ Id = "dfbfbe65-6f67-4876-9f75-699124334d06"
90+ }
91+ } )
92+ . Build ( ) ;
93+
94+ var page = await _client . Pages . CreateAsync ( pagesCreateParameters ) ;
95+
96+ page . Should ( ) . NotBeNull ( ) ;
97+ page . Parent . Should ( ) . BeOfType < DatabaseParent > ( ) . Which
98+ . DatabaseId . Should ( ) . Be ( "f86f2262-0751-40f2-8f63-e3f7a3c39fcb" ) ;
99+
100+ page . Properties . Should ( ) . ContainKey ( "Name" ) ;
101+ page . Properties [ "Name" ] . Should ( ) . BeOfType < TitlePropertyValue > ( ) . Which
102+ . Title . First ( ) . PlainText . Should ( ) . Be ( "Test Page Title" ) ;
103+
104+ await _client . Pages . UpdateAsync ( page . Id , new PagesUpdateParameters
105+ {
106+ Archived = true
107+ } ) ;
108+ }
57109 }
58110}
You can’t perform that action at this time.
0 commit comments