Skip to content

Commit

Permalink
OXDEV-8213: Remove filter and return check for authorization test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelOxid committed Jun 28, 2024
1 parent d992d30 commit d34a036
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface ThemeListInfrastructureInterface
{
/**
* @return array<ThemeDataType>
*@throws ThemesNotFound
* @throws ThemesNotFound
*/
public function getThemes(): array;
}
5 changes: 0 additions & 5 deletions tests/Codeception/Acceptance/BaseCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,4 @@ protected function getAdminPassword(): string
{
return self::ADMIN_PASSWORD;
}

public function getThemeId(): string
{
return getenv('THEME_ID') ?: 'apex';
}
}
19 changes: 2 additions & 17 deletions tests/Codeception/Acceptance/Theme/ThemeListCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,15 @@ public function testThemeListAuthorized(AcceptanceTester $I): void

$result = $this->runThemeListQuery($I);
$I->assertArrayNotHasKey('errors', $result);

$themeList = $result['data']['themesList'];

foreach ($themeList as $theme) {
$I->assertSame($this->getThemeId(), $theme['identifier']);
$I->assertTrue($theme['active']);
}
}

public function runThemeListQuery(AcceptanceTester $I): array
private function runThemeListQuery(AcceptanceTester $I): array
{
$I->login($this->getAdminUsername(), $this->getAdminPassword());
$themeId = $this->getThemeId();
$I->sendGQLQuery(
'query themeList {
themesList(
filters: {
active: {
equals: true
}
title: {
contains: "' . $themeId . '"
}
}
filters: null
) {
title
identifier
Expand Down

0 comments on commit d34a036

Please sign in to comment.