Skip to content

Commit

Permalink
KnitrReportTest: use checkExpectedErrors() (#2297)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-nicka authored Feb 26, 2025
1 parent d394a9d commit 44fee7d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/org/labkey/test/tests/KnitrReportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.labkey.test.tests;

import org.apache.hc.core5.http.HttpStatus;
import org.assertj.core.api.Assertions;
import org.jetbrains.annotations.Nullable;
import org.junit.Assume;
import org.junit.Test;
Expand Down Expand Up @@ -199,13 +200,11 @@ private void verifyAdhocReportDependencies(String viewName, String dependencies)

createKnitrReport(rmdDependenciesReport, RReportHelper.ReportOption.knitrMarkdown);

pauseJsErrorChecker(); // Don't fail due to "$ is not a function"
{
_rReportHelper.clickReportTab();
waitForElement(Locator.id("mtcars_table"));
assertElementNotPresent(Locator.id("mtcars_table_wrapper")); // Created by jQuery
}
resumeJsErrorChecker();
_rReportHelper.clickReportTab();
waitForElement(Locator.id("mtcars_table"));
assertElementNotPresent(Locator.id("mtcars_table_wrapper")); // Created by jQuery
Assertions.assertThat(getServerErrors()).as("Server errors").contains("$(...).dataTable is not a function");
checkExpectedErrors(1); // JavaScript error: "$(...).dataTable is not a function"

// now set the dependencies
_rReportHelper.clickSourceTab();
Expand Down

0 comments on commit 44fee7d

Please sign in to comment.