Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(tests): Limit notification testing to app='spreed'
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jul 31, 2024
commit 86f3a9f001b221fa3c05291513f2f3352b0cbe0b
10 changes: 7 additions & 3 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -3653,15 +3653,19 @@ public function userNotifications(string $user, ?TableNode $body = null): void {
);

$data = $this->getDataFromResponse($this->response);
$filteredNotifications = array_filter($data, static fn (array $notification) => $notification['app'] === 'spreed');
if (count($data) !== count($filteredNotifications)) {
echo 'Notifications were filtered by app=spreed';
}

if ($body === null) {
self::$lastNotifications = [];
Assert::assertCount(0, $data, json_encode($data, JSON_PRETTY_PRINT));
Assert::assertCount(0, $filteredNotifications, json_encode($data, JSON_PRETTY_PRINT));
return;
}

$this->assertNotifications($data, $body);
self::$lastNotifications = $data;
$this->assertNotifications($filteredNotifications, $body);
self::$lastNotifications = $filteredNotifications;
}

private function assertNotifications($notifications, TableNode $formData) {
Expand Down