Skip to content

Commit 81b2b10

Browse files
committed
add tests for the HasArchive trait
- to database, block and pages - change stubs regarding the archived-flag, to force testing to check for ``true`` as archived
1 parent 60bcca4 commit 81b2b10

File tree

6 files changed

+7
-3
lines changed

6 files changed

+7
-3
lines changed

tests/EndpointBlocksTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,5 +346,6 @@ public function it_retrieves_a_single_block()
346346

347347
$this->assertEquals('page_id', $block->getParentType());
348348
$this->assertEquals('f2939732-f694-4ce2-b613-f28db6ded673', $block->getParentId());
349+
$this->assertTrue($block->isArchived());
349350
}
350351
}

tests/EndpointDatabasesTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ public function it_returns_database_entity_with_filled_properties()
9494
$this->assertSame('Grocery List Description', $databaseResult->getDescription());
9595
$this->assertSame('database', $databaseResult->getObjectType());
9696
$this->assertSame('668d797c-76fa-4934-9b05-ad288df2d136', $databaseResult->getId());
97-
$this->assertTrue($databaseResult->getIsInline());
97+
$this->assertTrue($databaseResult->isInline());
98+
$this->assertTrue($databaseResult->isArchived());
9899

99100
$this->assertInstanceOf(RichText::class, $databaseResult->getRichTitle());
100101
$this->assertInstanceOf(RichText::class, $databaseResult->getRichDescription());

tests/EndpointPagesTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function it_returns_page_entity_with_filled_properties()
7575
$this->assertCount(9, $pageResult->getPropertyKeys());
7676
$this->assertSame('database_id', $pageResult->getParentType());
7777
$this->assertSame('f2939732-f694-4ce2-b613-f28db6ded673', $pageResult->getParentId());
78+
$this->assertTrue($pageResult->isArchived());
7879

7980
// check date and datetime properties
8081
$this->assertTrue($pageResult->getProperty('DateWithTime')->hasTime());

tests/stubs/endpoints/blocks/response_specific_block_200.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"created_time": "2021-05-17T13:51:00.000Z",
55
"last_edited_time": "2021-06-10T17:40:00.000Z",
66
"has_children": false,
7-
"archived": false,
7+
"archived": true,
88
"type": "paragraph",
99
"parent": {
1010
"type": "page_id",

tests/stubs/endpoints/databases/response_specific_200.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"page_id": "f2939732-f694-4ce2-b613-f28db6ded673"
99
},
1010
"is_inline": true,
11+
"archived": true,
1112
"description": [
1213
{
1314
"type": "text",

tests/stubs/endpoints/pages/response_specific_200.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "database_id",
88
"database_id": "f2939732-f694-4ce2-b613-f28db6ded673"
99
},
10-
"archived": false,
10+
"archived": true,
1111
"properties": {
1212
"NumberProp": {
1313
"id": ">d{N",

0 commit comments

Comments
 (0)