From af78ba64bd139718d77f1f3d6855e869472ddabf Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 31 May 2021 11:54:33 +0200 Subject: [PATCH] Don't change options of the globally used `PartialEvaluator` in the "should render checkbox with fallback font for printing" unit-test Given that the same `PartialEvaluator`-instance is used for a lot of these unit-tests, manually changing the options in any one test-case could lead to intermittently failing unit-tests since they're run in a random order. To fix this, we simply have to use the existing method to clone the `PartialEvaluator`-instance but with the custom options. --- test/unit/annotation_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/annotation_spec.js b/test/unit/annotation_spec.js index 7d8b50b45..ec88f8b65 100644 --- a/test/unit/annotation_spec.js +++ b/test/unit/annotation_spec.js @@ -2281,7 +2281,7 @@ describe("annotation", function () { { ref: buttonWidgetRef, data: buttonWidgetDict }, ]); const task = new WorkerTask("test print"); - partialEvaluator.options = { ignoreErrors: true }; + const checkboxEvaluator = partialEvaluator.clone({ ignoreErrors: true }); const annotation = await AnnotationFactory.create( xref, @@ -2293,7 +2293,7 @@ describe("annotation", function () { annotationStorage.set(annotation.data.id, { value: true }); const operatorList = await annotation.getOperatorList( - partialEvaluator, + checkboxEvaluator, task, false, annotationStorage