wip: finalize implementation
This commit is contained in:
@@ -15,6 +15,7 @@ class AppRuntime implements RuntimeExtensionInterface
|
||||
private readonly IntlExtension $intlExtension,
|
||||
private readonly CountryDataProvider $countryDataProvider,
|
||||
private readonly ParticipantEligibilityService $participantEligibilityService,
|
||||
private readonly string $environment,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -101,4 +102,25 @@ class AppRuntime implements RuntimeExtensionInterface
|
||||
{
|
||||
return $this->participantEligibilityService->isParticipantEligible($bookingDto, $participantIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a QA attribute for testing purposes.
|
||||
*
|
||||
* @param string $label The label for the QA attribute
|
||||
* @param string|null $value The value for the QA attribute
|
||||
*
|
||||
* @return string The rendered QA attribute
|
||||
*/
|
||||
public function renderQaAttribute(string $label, ?string $value = null): string
|
||||
{
|
||||
if ('prod' === $this->environment) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (null === $value) {
|
||||
return sprintf(' data-qa-%s', strtolower($label));
|
||||
}
|
||||
|
||||
return sprintf(' data-qa-%s="%s"', strtolower($label), $value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user