mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-28 22:41:13 -05:00
fix: notification comment tag tests
Tagging a user while creating a comment will both create a notification for the tag, as well as create a notification to the user who made the torrent/request. We only want to assert that the count of notifications created during the test is 1 only for the tag notifications and not count the other notification created.
This commit is contained in:
@@ -75,10 +75,10 @@ test('user tags user on request creates a notification for tagged user', functio
|
||||
$this->assertEquals(1, Comment::count());
|
||||
|
||||
Notification::assertSentTo(
|
||||
[$user],
|
||||
NewCommentTag::class
|
||||
$user,
|
||||
NewCommentTag::class,
|
||||
1,
|
||||
);
|
||||
Notification::assertCount(1);
|
||||
});
|
||||
|
||||
test('user tags user on request creates a notification for tagged user when mentions are disabled for other specific group', function (): void {
|
||||
@@ -128,11 +128,11 @@ test('user tags user on request creates a notification for tagged user when ment
|
||||
|
||||
$this->assertEquals(1, Comment::count());
|
||||
|
||||
Notification::assertSentTo(
|
||||
[$user],
|
||||
NewCommentTag::class
|
||||
Notification::assertSentToTimes(
|
||||
$user,
|
||||
NewCommentTag::class,
|
||||
1,
|
||||
);
|
||||
Notification::assertCount(1);
|
||||
});
|
||||
|
||||
test('user tags user on request does not create a notification for tagged user when all notifications disabled', function (): void {
|
||||
|
||||
@@ -74,11 +74,11 @@ test('user tags user on torrent creates a notification for tagged user', functio
|
||||
|
||||
$this->assertEquals(1, Comment::count());
|
||||
|
||||
Notification::assertSentTo(
|
||||
[$user],
|
||||
NewCommentTag::class
|
||||
Notification::assertSentToTimes(
|
||||
$user,
|
||||
NewCommentTag::class,
|
||||
1,
|
||||
);
|
||||
Notification::assertCount(1);
|
||||
});
|
||||
|
||||
test('user tags user on torrent creates a notification for tagged user when mentions are disabled for other specific group', function (): void {
|
||||
@@ -128,11 +128,11 @@ test('user tags user on torrent creates a notification for tagged user when ment
|
||||
|
||||
$this->assertEquals(1, Comment::count());
|
||||
|
||||
Notification::assertSentTo(
|
||||
[$user],
|
||||
NewCommentTag::class
|
||||
Notification::assertSentToTimes(
|
||||
$user,
|
||||
NewCommentTag::class,
|
||||
1,
|
||||
);
|
||||
Notification::assertCount(1);
|
||||
});
|
||||
|
||||
test('user tags user on torrent does not create a notification for tagged user when all notifications disabled', function (): void {
|
||||
|
||||
@@ -93,11 +93,11 @@ test('user tags user in forum topic creates a notification for tagged user', fun
|
||||
'user_id' => $poster->id,
|
||||
]);
|
||||
|
||||
Notification::assertSentTo(
|
||||
[$user],
|
||||
NewPostTag::class
|
||||
Notification::assertSentToTimes(
|
||||
$user,
|
||||
NewPostTag::class,
|
||||
1,
|
||||
);
|
||||
Notification::assertCount(1);
|
||||
});
|
||||
|
||||
test('user tags user in forum topic creates a notification for tagged user when post mention notifications are not disabled for specific group', function (): void {
|
||||
@@ -166,11 +166,11 @@ test('user tags user in forum topic creates a notification for tagged user when
|
||||
'user_id' => $poster->id,
|
||||
]);
|
||||
|
||||
Notification::assertSentTo(
|
||||
[$user],
|
||||
NewPostTag::class
|
||||
Notification::assertSentToTimes(
|
||||
$user,
|
||||
NewPostTag::class,
|
||||
1,
|
||||
);
|
||||
Notification::assertCount(1);
|
||||
});
|
||||
|
||||
test('user tags user in forum topic does not create a notification for tagged user when all notifications disabled', function (): void {
|
||||
@@ -241,7 +241,6 @@ test('user tags user in forum topic does not create a notification for tagged us
|
||||
[$user],
|
||||
NewPostTag::class
|
||||
);
|
||||
Notification::assertCount(0);
|
||||
});
|
||||
|
||||
test('staff tags user in forum topic creates a notification for tagged user even when post mention notifications are disabled', function (): void {
|
||||
@@ -309,11 +308,11 @@ test('staff tags user in forum topic creates a notification for tagged user even
|
||||
'user_id' => $poster->id,
|
||||
]);
|
||||
|
||||
Notification::assertSentTo(
|
||||
[$user],
|
||||
NewPostTag::class
|
||||
Notification::assertSentToTimes(
|
||||
$user,
|
||||
NewPostTag::class,
|
||||
1,
|
||||
);
|
||||
Notification::assertCount(1);
|
||||
});
|
||||
|
||||
test('user tags user in forum topic does not create a notification for tagged user when post mention notifications are disabled', function (): void {
|
||||
@@ -384,7 +383,6 @@ test('user tags user in forum topic does not create a notification for tagged us
|
||||
[$user],
|
||||
NewPostTag::class
|
||||
);
|
||||
Notification::assertCount(0);
|
||||
});
|
||||
|
||||
test('user tags user in forum topic does not create a notification for tagged user when post mention notifications are not disabled for specific group', function (): void {
|
||||
@@ -456,5 +454,4 @@ test('user tags user in forum topic does not create a notification for tagged us
|
||||
[$user],
|
||||
NewPostTag::class
|
||||
);
|
||||
Notification::assertCount(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user