Skip to content

Commit 17770bd

Browse files
committed
add visit monitoring skip store when guest mode is off and user not logged in test
1 parent b04db83 commit 17770bd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/Feature/VisitMonitoringTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
// Ajax
6363

6464
test('visit monitoring store ajax requests', function () {
65-
\Pest\Laravel\withoutExceptionHandling();
6665
get('/', ['X-Requested-With' => 'XMLHttpRequest']);
6766

6867
// DB Assertions
@@ -80,6 +79,17 @@
8079
assertDatabaseMissing(config('user-monitoring.visit_monitoring.table'), ['page' => 'http:\/\/localhost']);
8180
});
8281

82+
test('visit monitoring skip store when guest mode is off and user not logged in', function () {
83+
config()->set('user-monitoring.visit_monitoring.guest_mode', false);
84+
85+
$response = get('/');
86+
$response->assertContent('milwad');
87+
88+
// DB Assertions
89+
assertDatabaseCount(config('user-monitoring.visit_monitoring.table'), 0);
90+
assertDatabaseMissing(config('user-monitoring.visit_monitoring.table'), ['page' => 'http:\/\/localhost']);
91+
});
92+
8393
/**
8494
* Create user.
8595
*

0 commit comments

Comments
 (0)