1
0
Fork 0
mirror of synced 2024-10-01 01:37:56 +13:00

Merge branch '1.5.x' into messaging-uniform-logic

This commit is contained in:
Jake Barnby 2024-01-09 13:53:19 +13:00 committed by GitHub
commit 745f49541e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 5 deletions

View file

@ -7,6 +7,7 @@ class Topics extends Base
public const ALLOWED_ATTRIBUTES = [
'name',
'description',
'total'
];
/**

View file

@ -5,6 +5,7 @@ namespace Tests\E2E\Services\Messaging;
use Tests\E2E\Client;
use Utopia\App;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Query;
use Utopia\DSN\DSN;
trait MessagingBase
@ -173,11 +174,11 @@ trait MessagingBase
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'name' => 'Mailgun2',
'apiKey' => 'my-apikey',
'domain' => 'my-domain',
'isEuRegion' => true,
'enabled' => false,
'name' => 'Mailgun2',
'apiKey' => 'my-apikey',
'domain' => 'my-domain',
'isEuRegion' => true,
'enabled' => false,
]);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals('Mailgun2', $response['body']['name']);
@ -283,6 +284,32 @@ trait MessagingBase
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(1, \count($response['body']['topics']));
$response = $this->client->call(Client::METHOD_GET, '/messaging/topics', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'queries' => [
'equal("total", [0])'
],
]);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(1, \count($response['body']['topics']));
$response = $this->client->call(Client::METHOD_GET, '/messaging/topics', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'queries' => [
'greaterThan("total", 0)'
],
]);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(0, \count($response['body']['topics']));
return $topicId;
}