mirror of
https://github.com/dstotijn/go-notion.git
synced 2025-06-15 00:05:04 +02:00
Add description
field to Database
struct type (#34)
This commit is contained in:
@ -995,6 +995,13 @@ func TestCreateDatabase(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
Description: []notion.RichText{
|
||||
{
|
||||
Text: ¬ion.Text{
|
||||
Content: "Lorem ipsum dolor sit amet.",
|
||||
},
|
||||
},
|
||||
},
|
||||
Properties: notion.DatabaseProperties{
|
||||
"Title": notion.DatabaseProperty{
|
||||
Type: notion.DBPropTypeTitle,
|
||||
@ -1040,6 +1047,25 @@ func TestCreateDatabase(t *testing.T) {
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Lorem ipsum dolor sit amet.",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Lorem ipsum dolor sit amet.",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Title": {
|
||||
"id": "title",
|
||||
@ -1078,6 +1104,13 @@ func TestCreateDatabase(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
"description": []interface{}{
|
||||
map[string]interface{}{
|
||||
"text": map[string]interface{}{
|
||||
"content": "Lorem ipsum dolor sit amet.",
|
||||
},
|
||||
},
|
||||
},
|
||||
"properties": map[string]interface{}{
|
||||
"Title": map[string]interface{}{
|
||||
"type": "title",
|
||||
@ -1117,6 +1150,18 @@ func TestCreateDatabase(t *testing.T) {
|
||||
PlainText: "Foobar",
|
||||
},
|
||||
},
|
||||
Description: []notion.RichText{
|
||||
{
|
||||
Type: notion.RichTextTypeText,
|
||||
Text: ¬ion.Text{
|
||||
Content: "Lorem ipsum dolor sit amet.",
|
||||
},
|
||||
Annotations: ¬ion.Annotations{
|
||||
Color: notion.ColorDefault,
|
||||
},
|
||||
PlainText: "Lorem ipsum dolor sit amet.",
|
||||
},
|
||||
},
|
||||
Properties: notion.DatabaseProperties{
|
||||
"Title": notion.DatabaseProperty{
|
||||
ID: "title",
|
||||
@ -1284,6 +1329,13 @@ func TestUpdateDatabase(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
Description: []notion.RichText{
|
||||
{
|
||||
Text: ¬ion.Text{
|
||||
Content: "Updated description.",
|
||||
},
|
||||
},
|
||||
},
|
||||
Properties: map[string]*notion.DatabaseProperty{
|
||||
"New": {
|
||||
Type: notion.DBPropTypeRichText,
|
||||
@ -1330,6 +1382,25 @@ func TestUpdateDatabase(t *testing.T) {
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Updated description.",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Updated description.",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Name": {
|
||||
"id": "title",
|
||||
@ -1369,6 +1440,13 @@ func TestUpdateDatabase(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
"description": []interface{}{
|
||||
map[string]interface{}{
|
||||
"text": map[string]interface{}{
|
||||
"content": "Updated description.",
|
||||
},
|
||||
},
|
||||
},
|
||||
"properties": map[string]interface{}{
|
||||
"New": map[string]interface{}{
|
||||
"type": "rich_text",
|
||||
@ -1405,6 +1483,18 @@ func TestUpdateDatabase(t *testing.T) {
|
||||
PlainText: "Grocery List",
|
||||
},
|
||||
},
|
||||
Description: []notion.RichText{
|
||||
{
|
||||
Type: notion.RichTextTypeText,
|
||||
Text: ¬ion.Text{
|
||||
Content: "Updated description.",
|
||||
},
|
||||
Annotations: ¬ion.Annotations{
|
||||
Color: notion.ColorDefault,
|
||||
},
|
||||
PlainText: "Updated description.",
|
||||
},
|
||||
},
|
||||
Properties: notion.DatabaseProperties{
|
||||
"Name": notion.DatabaseProperty{
|
||||
ID: "title",
|
||||
|
Reference in New Issue
Block a user