feat(tests): added tests for projects usage
This commit is contained in:
parent
94a17e9ce0
commit
9eea6d55f7
3 changed files with 14 additions and 19 deletions
|
@ -7,7 +7,7 @@ use Tests\E2E\Scopes\ProjectCustom;
|
|||
use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\SideConsole;
|
||||
|
||||
class DatabaseConsoleTest extends Scope
|
||||
class DatabaseConsoleClientTest extends Scope
|
||||
{
|
||||
use ProjectCustom;
|
||||
use SideConsole;
|
||||
|
@ -61,6 +61,7 @@ class DatabaseConsoleTest extends Scope
|
|||
]);
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals(count($response['body']), 11);
|
||||
$this->assertEquals($response['body']['range'], '24h');
|
||||
$this->assertIsArray($response['body']['documents.count']);
|
||||
$this->assertIsArray($response['body']['collections.count']);
|
||||
|
@ -113,6 +114,7 @@ class DatabaseConsoleTest extends Scope
|
|||
]);
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals(count($response['body']), 6);
|
||||
$this->assertEquals($response['body']['range'], '24h');
|
||||
$this->assertIsArray($response['body']['documents.count']);
|
||||
$this->assertIsArray($response['body']['documents.create']);
|
|
@ -7,7 +7,7 @@ use Tests\E2E\Scopes\ProjectCustom;
|
|||
use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\SideConsole;
|
||||
|
||||
class FunctionsConsoleTest extends Scope
|
||||
class FunctionsConsoleClientTest extends Scope
|
||||
{
|
||||
use ProjectCustom;
|
||||
use SideConsole;
|
||||
|
@ -81,6 +81,7 @@ class FunctionsConsoleTest extends Scope
|
|||
]);
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals(count($response['body']), 4);
|
||||
$this->assertEquals($response['body']['range'], '24h');
|
||||
$this->assertIsArray($response['body']['functions.executions']);
|
||||
$this->assertIsArray($response['body']['functions.failures']);
|
|
@ -215,24 +215,16 @@ class ProjectsConsoleClientTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(count($response['body']), 8);
|
||||
$this->assertNotEmpty($response['body']);
|
||||
$this->assertArrayHasKey('collections', $response['body']);
|
||||
$this->assertArrayHasKey('documents', $response['body']);
|
||||
$this->assertArrayHasKey('network', $response['body']);
|
||||
$this->assertArrayHasKey('requests', $response['body']);
|
||||
$this->assertArrayHasKey('storage', $response['body']);
|
||||
$this->assertArrayHasKey('users', $response['body']);
|
||||
$this->assertIsArray($response['body']['collections']['data']);
|
||||
$this->assertIsInt($response['body']['collections']['total']);
|
||||
$this->assertIsArray($response['body']['documents']['data']);
|
||||
$this->assertIsInt($response['body']['documents']['total']);
|
||||
$this->assertIsArray($response['body']['network']['data']);
|
||||
$this->assertIsInt($response['body']['network']['total']);
|
||||
$this->assertIsArray($response['body']['requests']['data']);
|
||||
$this->assertIsInt($response['body']['requests']['total']);
|
||||
$this->assertIsInt($response['body']['storage']['total']);
|
||||
$this->assertIsArray($response['body']['users']['data']);
|
||||
$this->assertIsInt($response['body']['users']['total']);
|
||||
$this->assertEquals('30d', $response['body']['range']);
|
||||
$this->assertIsArray($response['body']['requests']);
|
||||
$this->assertIsArray($response['body']['network']);
|
||||
$this->assertIsArray($response['body']['functions']);
|
||||
$this->assertIsArray($response['body']['documents']);
|
||||
$this->assertIsArray($response['body']['collections']);
|
||||
$this->assertIsArray($response['body']['users']);
|
||||
$this->assertIsArray($response['body']['storage']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
|
Loading…
Reference in a new issue