summaryrefslogtreecommitdiff
path: root/test/test-database.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-08-31 21:42:18 -0400
committerGitHub <noreply@github.com>2021-08-31 21:42:18 -0400
commit1599ec1f15ef02e5687fbfc4ad15dd55b019ee70 (patch)
tree7c42d74d3487e8934de108739ad437f0cdc3fc86 /test/test-database.js
parent02194fcb9f5dfd61482b6d3814e395a1225c8a9b (diff)
Fix dictionary import total progress (#1921)
* Fix incorrect total count for final step of dictionary import * Update tests to validate progress args
Diffstat (limited to 'test/test-database.js')
-rw-r--r--test/test-database.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test-database.js b/test/test-database.js
index 21c653be..e855f07f 100644
--- a/test/test-database.js
+++ b/test/test-database.js
@@ -43,7 +43,14 @@ function createTestDictionaryArchive(dictionary, dictionaryName) {
function createDictionaryImporter(onProgress) {
const dictionaryImporterMediaLoader = new DatabaseVMDictionaryImporterMediaLoader();
- return new DictionaryImporter(dictionaryImporterMediaLoader, onProgress);
+ return new DictionaryImporter(dictionaryImporterMediaLoader, (...args) => {
+ const {stepIndex, stepCount, index, count} = args[0];
+ assert.ok(stepIndex < stepCount);
+ assert.ok(index <= count);
+ if (typeof onProgress === 'function') {
+ onProgress(...args);
+ }
+ });
}