Skip to content

Commit

Permalink
Merge pull request #2214 from RotherOSS/issue-#2213-encoding-unit-tes…
Browse files Browse the repository at this point in the history
…t-failure

Issue #2213: Dynamic field value in column filtering is no longer dou…
  • Loading branch information
bschmalhofer authored Mar 6, 2023
2 parents 4f4a9ff + 792b454 commit 700cfc5
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions scripts/test/Selenium/Output/Ticket/OverviewSmall.t
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,16 @@ $Selenium->RunTest(
$Selenium->find_element("//a[contains(\@title, \'$DFName, filter not active\' )]")->click();

for my $Test (@Tests) {
my $LinkEncodedKey = $LayoutObject->LinkEncode( $Test->{Key} );

$Selenium->WaitFor(
JavaScript =>
"return typeof(\$) === 'function' && \$('#ColumnFilterDynamicField_${DFName}0120-TicketNew option[value=\"$LinkEncodedKey\"]').length;"
"return typeof(\$) === 'function' && \$('#ColumnFilterDynamicField_${DFName}0120-TicketNew option[value=\"$Test->{Key}\"]').length;"
);

$Self->True(
$Selenium->execute_script(
"return \$('#ColumnFilterDynamicField_${DFName}0120-TicketNew option[value=\"$LinkEncodedKey\"]').length;"
"return \$('#ColumnFilterDynamicField_${DFName}0120-TicketNew option[value=\"$Test->{Key}\"]').length;"
),
"Key '$Test->{Key}' is found as correctly encoded - '$LinkEncodedKey'"
"Key '$Test->{Key}' is found as correctly encoded - '$Test->{Key}'"
);
}

Expand All @@ -266,18 +264,16 @@ $Selenium->RunTest(
$Selenium->find_element("//a[contains(\@title, \'$DFName, filter not active\' )]")->click();

for my $Test (@Tests) {
my $LinkEncodedKey = $LayoutObject->LinkEncode( $Test->{Key} );

$Selenium->WaitFor(
JavaScript =>
"return typeof(\$) === 'function' && \$('#ColumnFilterDynamicField_$DFName option[value=\"$LinkEncodedKey\"]').length;"
"return typeof(\$) === 'function' && \$('#ColumnFilterDynamicField_$DFName option[value=\"$Test->{Key}\"]').length;"
);

$Self->True(
$Selenium->execute_script(
"return \$('#ColumnFilterDynamicField_$DFName option[value=\"$LinkEncodedKey\"]').length;"
"return \$('#ColumnFilterDynamicField_$DFName option[value=\"$Test->{Key}\"]').length;"
),
"Key '$Test->{Key}' is found as correctly encoded - '$LinkEncodedKey'"
"Key '$Test->{Key}' is found as correctly encoded - '$Test->{Key}'"
);
}

Expand Down

0 comments on commit 700cfc5

Please sign in to comment.