From 11066e55fbe5f738e9b8ad690d6be60071362aa8 Mon Sep 17 00:00:00 2001 From: nxi Date: Fri, 23 Aug 2024 14:49:12 +1000 Subject: [PATCH] add Qunit web test --- .../WebContent/QUnit.html | 15 +++++++++++++++ .../WebContent/js/QUnitCases.js | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/QUnit.html create mode 100644 bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/js/QUnitCases.js diff --git a/bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/QUnit.html b/bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/QUnit.html new file mode 100644 index 000000000..4fda18623 --- /dev/null +++ b/bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/QUnit.html @@ -0,0 +1,15 @@ + + +Test Suite + + +
+
+ + + + + + diff --git a/bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/js/QUnitCases.js b/bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/js/QUnitCases.js new file mode 100644 index 000000000..8536ee95c --- /dev/null +++ b/bragg/nbi/au.gov.ansto.bragg.nbi.webserver/WebContent/js/QUnitCases.js @@ -0,0 +1,19 @@ +function add(a, b) { + return a + b; +} + +QUnit.module('add', function() { + QUnit.test('two numbers', function(assert) { + const a = 2; + assert.equal(add(1, a), 3); + }); +}); + +QUnit.module('SEDB', function() { + QUnit.test('DBModel', function(assert) { + assert.equal(add(1, 2), 3); + const dbModel = new DBModel(); + dbModel.load(); + assert.ok(dbModel != null); + }); +}); \ No newline at end of file