Skip to content

Commit c4e7dc9

Browse files
committed
Fix tests
1 parent 05d76ee commit c4e7dc9

2 files changed

Lines changed: 15 additions & 16 deletions

File tree

tests/Http/Api/Commands/ApiEntityListQuickCreationCommandControllerTest.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,6 @@ public function update($id, array $data)
273273
}
274274
});
275275

276-
$this->get(route('code16.sharp.list', ['root', 'person']));
277-
278276
$this
279277
->postJson(
280278
route('code16.sharp.api.list.command.quick-creation-form.create', [
@@ -283,6 +281,9 @@ public function update($id, array $data)
283281
'formEntityKey' => 'person',
284282
]),
285283
['data' => ['name' => 'Marie Curie']],
284+
headers: [
285+
SharpBreadcrumb::CURRENT_PAGE_URL_HEADER => url('/sharp/root/s-list/person'),
286+
]
286287
)
287288
->assertOk()
288289
->assertJson([
@@ -315,23 +316,18 @@ public function update($id, array $data)
315316
}
316317
});
317318

318-
// Simulate a get of the person show page
319-
$this
320-
->get(
321-
route('code16.sharp.show.show', [
322-
'globalFilter' => 'root',
323-
'parentUri' => 's-list/person/',
324-
'person',
325-
1,
326-
])
327-
)
328-
->assertOk();
329-
330319
// Simulate a post of the colleague quick creation command from an EEL
331320
$this
332321
->postJson(
333-
route('code16.sharp.api.list.command.quick-creation-form.create', ['colleague', 'colleague']),
322+
route('code16.sharp.api.list.command.quick-creation-form.create', [
323+
'globalFilter' => 'root',
324+
'entityKey' => 'colleague',
325+
'formEntityKey' => 'colleague',
326+
]),
334327
['data' => ['name' => 'Marie Curie']],
328+
headers: [
329+
SharpBreadcrumb::CURRENT_PAGE_URL_HEADER => url('/sharp/root/s-list/person/s-show/person/1'),
330+
]
335331
)
336332
->assertOk()
337333
->assertJson([

tests/Http/Auth/AuthorizationsTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Code16\Sharp\Auth\SharpAuthenticationCheckHandler;
44
use Code16\Sharp\Auth\SharpEntityPolicy;
5+
use Code16\Sharp\Http\Context\SharpBreadcrumb;
56
use Code16\Sharp\Tests\Fixtures\Entities\PersonEntity;
67
use Code16\Sharp\Tests\Fixtures\Entities\SinglePersonEntity;
78
use Code16\Sharp\Tests\Fixtures\User;
@@ -208,7 +209,9 @@ public function getListData(): array|Arrayable
208209

209210
// EEL (json)
210211
$this
211-
->getJson('/sharp/api/root/list/person')
212+
->getJson('/sharp/api/root/list/person', headers: [
213+
SharpBreadcrumb::CURRENT_PAGE_URL_HEADER => url('/sharp/root/s-list/person/s-show/person/1'),
214+
])
212215
->assertJson(fn (AssertableJson $json) => $json
213216
->where('authorizations.reorder', true)
214217
->where('authorizations.create', true)

0 commit comments

Comments
 (0)