Skip to content

Commit

Permalink
fix(forms): Fixed E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ccailly committed Nov 5, 2024
1 parent 3f6c9ba commit 73e0d47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Glpi/Form/QuestionType/QuestionTypeUserDevice.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ public function validateExtraDataInput(array $input): bool
*/
public function isMultipleDevices(?Question $question): bool
{
if ($question === null) {
return false;
}

/** @var ?QuestionTypeUserDevicesConfig $config */
$config = $this->getConfig($question);
$config = $this->getExtraDataConfig(json_decode($question->fields['extra_data'], true) ?? []);
if ($config === null) {
return false;
}
Expand Down Expand Up @@ -268,7 +272,7 @@ public function isAllowedForUnauthenticatedAccess(): bool
}

#[Override]
public function getConfigClass(): ?string
public function getExtraDataConfigClass(): ?string
{
return QuestionTypeUserDevicesConfig::class;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ module.exports = defineConfig({
e2e: {
baseUrl: "http://localhost:80",
experimentalMemoryManagement: true,
retries: {
runMode: 3,
},
setupNodeEvents(on) {
// implement node event listeners here
// Remove --start-maximized flag from Chrome
Expand Down

0 comments on commit 73e0d47

Please sign in to comment.