over naar uuids, policies, predefined mutations aan kunnen passen
This commit is contained in:
@@ -19,7 +19,7 @@ test('authenticated users can visit the dashboard', function () {
|
||||
|
||||
$response = $this->get(route('dashboard'));
|
||||
$response->assertOk();
|
||||
$response->assertInertia(fn ($page) => $page->component('Dashboard')->has('unreadEntities'));
|
||||
$response->assertInertia(fn ($page) => $page->component('Dashboard')->has('unreadDynamics'));
|
||||
});
|
||||
|
||||
test('visiting dynamic updates the read cursor', function () {
|
||||
@@ -34,7 +34,7 @@ test('visiting dynamic updates the read cursor', function () {
|
||||
expect($initialCursor->toIso8601String())->toBe('1970-01-01T00:00:00+00:00');
|
||||
|
||||
// Visit Dynamic Show
|
||||
$this->get(route('dynamics.show', $dynamic->id))->assertOk();
|
||||
$this->get(route('dynamics.show', $dynamic->uuid))->assertOk();
|
||||
|
||||
// Re-check cursor is updated to near now
|
||||
$updatedCursor = $service->getCursorReadAt($user, $dynamic);
|
||||
@@ -56,7 +56,7 @@ test('visiting ledger updates the read cursor', function () {
|
||||
expect($initialCursor->toIso8601String())->toBe('1970-01-01T00:00:00+00:00');
|
||||
|
||||
// Visit Ledger Show
|
||||
$this->get(route('dynamics.ledgers.show', [$dynamic->id, $ledger->id]))->assertOk();
|
||||
$this->get(route('dynamics.ledgers.show', [$dynamic->uuid, $ledger->uuid]))->assertOk();
|
||||
|
||||
// Re-check cursor is updated to near now
|
||||
$updatedCursor = $service->getCursorReadAt($user, $ledger);
|
||||
@@ -101,23 +101,23 @@ test('dashboard groups and filters unread entities correctly based on cursor', f
|
||||
// Verify unread grouping structure
|
||||
$response->assertInertia(fn ($page) => $page
|
||||
->component('Dashboard')
|
||||
->where('unreadEntities.0.name', 'Testing Dynamic')
|
||||
->where('unreadEntities.0.unread_count', 1)
|
||||
->has('unreadEntities.0.context_activities', 1) // Should have old message as context
|
||||
->where('unreadEntities.0.context_activities.0.content', 'Old message context')
|
||||
->has('unreadEntities.0.new_activities', 1) // Should have unread message
|
||||
->where('unreadEntities.0.new_activities.0.content', 'New unread message alert')
|
||||
->where('unreadDynamics.0.name', 'Testing Dynamic')
|
||||
->where('unreadDynamics.0.unread_count', 1)
|
||||
->has('unreadDynamics.0.context_activities', 1) // Should have old message as context
|
||||
->where('unreadDynamics.0.context_activities.0.content', 'Old message context')
|
||||
->has('unreadDynamics.0.new_activities', 1) // Should have unread message
|
||||
->where('unreadDynamics.0.new_activities.0.content', 'New unread message alert')
|
||||
);
|
||||
|
||||
// Now visit the Dynamic, which clears the unread count
|
||||
$this->get(route('dynamics.show', $dynamic->id))->assertOk();
|
||||
$this->get(route('dynamics.show', $dynamic->uuid))->assertOk();
|
||||
|
||||
// Dashboard should now show 0 unread groups (caught up)
|
||||
$response2 = $this->get(route('dashboard'));
|
||||
$response2->assertOk();
|
||||
$response2->assertInertia(fn ($page) => $page
|
||||
->component('Dashboard')
|
||||
->has('unreadEntities', 0)
|
||||
->has('unreadDynamics', 0)
|
||||
);
|
||||
|
||||
Carbon::setTestNow(); // Reset test time
|
||||
|
||||
Reference in New Issue
Block a user