Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use
Ext.Loader.syncRequire
to load required classes in tests and wait forExt.onReady
to run tests.Any test that uses a variable such as
CpsiMapview.controller.grid.Grid
will need to ensure it is loaded for the test by adding:Ext.Loader.syncRequire(['CpsiMapview.controller.grid.Grid']);
Alternatively using
Ext.create("CpsiMapview.controller.grid.Grid")
can be used to dynamically load the test.This is an attempt to avoid flaky tests when merging code - see failures at https://github.com/compassinformatics/cpsi-mapview/commits/master
These are mainly due to the test map component being ready causing errors such as
TypeError: Cannot read properties of undefined (reading 'map')
. Overriding the karma loading process, similar to the approach described at https://stackoverflow.com/a/27390799/179520, only runs the tests once the ExtJS framework is ready.It also avoids warnings that ExtJS classes have been loaded twice, such as
WARN: '[W] [Ext.define] Duplicate class name 'BasiGX.view.form.CoordinateTransform' specified, must be a non-empty string'
.The move to using
syncRequire
highlighted some discrepancies in class names and missing requires which have been addressed in other pull requests.