Skip to content

Commit 2edd4ea

Browse files
committed
add query names to RecordedEndpoint tests
1 parent 53c15fb commit 2edd4ea

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

tests/RecordedEndpointCommentsTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
use FiveamCode\LaravelNotionApi\Exceptions\NotionException;
88
use Illuminate\Support\Facades\Http;
99

10+
$httpRecorder = null;
11+
1012
beforeEach(function () {
11-
Http::recordAndFakeLater('https://api.notion.com/v1/comments*')
13+
$this->httpRecorder = Http::recordAndFakeLater('https://api.notion.com/v1/comments*')
1214
->storeIn('snapshots/comments');
1315
});
1416

1517
it('should fetch list of comments with an accurate representation of attributes', function () {
18+
$this->httpRecorder->nameForNextRequest('list-of-comments');
19+
1620
$commentCollection = \Notion::comments()->ofBlock('cb588bcbcbdb4f2eac3db05446b8f5d9');
1721

1822
$collection = $commentCollection->asCollection();
@@ -41,6 +45,7 @@
4145
});
4246

4347
it('should throw correct exception if block_id has not been found when listing comments', function () {
48+
$this->httpRecorder->nameForNextRequest('comment-not-found');
4449
$this->expectException(NotionException::class);
4550
$this->expectExceptionMessage('Not Found');
4651
$this->expectExceptionCode(404);

tests/RecordedEndpointDatabasesCreationTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@
2121
use FiveamCode\LaravelNotionApi\Entities\Properties\Url;
2222
use Illuminate\Support\Facades\Http;
2323

24+
$httpRecorder = null;
25+
2426
beforeEach(function () {
25-
Http::recordAndFakeLater('https://api.notion.com/v1/databases*')
27+
$this->httpRecorder = Http::recordAndFakeLater('https://api.notion.com/v1/databases*')
2628
->storeIn('snapshots/databases');
2729
});
2830

2931
it('should create a new database with all available properties', function () {
3032

33+
$this->httpRecorder->nameForNextRequest('all-properties');
34+
3135
$selectOptions = [
3236
[
3337
'name' => 'testing',

0 commit comments

Comments
 (0)