From 042403640ee04994f7a1715d2c4c5b3bb7db40e6 Mon Sep 17 00:00:00 2001 From: Joost Timmerman Date: Mon, 26 Apr 2021 11:28:13 +0200 Subject: [PATCH] Update test for ZXing refactor (#184) --- test/test.html5-qrcode.html | 4 ++-- test/test.html5-qrcode.js | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/test/test.html5-qrcode.html b/test/test.html5-qrcode.html index 33b2267..38e6d59 100644 --- a/test/test.html5-qrcode.html +++ b/test/test.html5-qrcode.html @@ -17,8 +17,8 @@ - - + + diff --git a/test/test.html5-qrcode.js b/test/test.html5-qrcode.js index 64b963c..aa9d0d7 100644 --- a/test/test.html5-qrcode.js +++ b/test/test.html5-qrcode.js @@ -14,11 +14,10 @@ describe('Constructor', function() { assert.notEqual(html5Qrcode, undefined); }); - it('Constructor fails if qrcode not defined', function() { - const expectedErrorMessage = "qrcode is not defined, use the minified" - + "/html5-qrcode.min.js for proper support"; - const __getLazarSoftScanner = getLazarSoftScanner; - getLazarSoftScanner = function() { return undefined; }; + it('Constructor fails if ZXing not defined', function() { + const expectedErrorMessage = "Use html5qrcode.min.js without edit, ZXing not found."; + const __ZXing = ZXing; + ZXing = undefined; try { new Html5Qrcode("qr"); assert.fail("exception should be thrown"); @@ -26,7 +25,7 @@ describe('Constructor', function() { assert.equal(exception, expectedErrorMessage); } - getLazarSoftScanner = __getLazarSoftScanner; + ZXing = __ZXing; }); describe('Verbosity is set', function() {