diff --git a/LogarithmPlotter/util/js.py b/LogarithmPlotter/util/js.py index ffdab5c..dbe60bc 100644 --- a/LogarithmPlotter/util/js.py +++ b/LogarithmPlotter/util/js.py @@ -16,14 +16,13 @@ * along with this program. If not, see . """ from re import Pattern -from PySide6.QtCore import QMetaObject, QObject +from PySide6.QtCore import QMetaObject, QObject, QDateTime from PySide6.QtQml import QJSValue class InvalidAttributeValueException(Exception): pass class NotAPrimitiveException(Exception): pass class Function: pass -class Date: pass class URL: pass class PyJSValue: @@ -80,7 +79,7 @@ class PyJSValue: (lambda: self.qjs_value.isArray(), list), (lambda: self.qjs_value.isBool(), bool), (lambda: self.qjs_value.isCallable(), Function), - (lambda: self.qjs_value.isDate(), Date), + (lambda: self.qjs_value.isDate(), QDateTime), (lambda: self.qjs_value.isError(), Exception), (lambda: self.qjs_value.isNull(), None), (lambda: self.qjs_value.isNumber(), float), diff --git a/tests/python/test_main.py b/tests/python/test_main.py index d96bb4a..b15ee02 100644 --- a/tests/python/test_main.py +++ b/tests/python/test_main.py @@ -95,4 +95,15 @@ class TestMain: engine, js_globals = create_engine(helper, latex, 0) assert len(engine.rootObjects()) > 0 # QML File loaded. assert type(engine.rootContext().contextProperty("TestBuild")) is bool - assert engine.rootContext().contextProperty("StartTime") == 0 \ No newline at end of file + assert engine.rootContext().contextProperty("StartTime") == 0 + assert js_globals.Latex.type() is not None + assert js_globals.Helper.type() is not None + assert js_globals.Modules.type() is not None + # Check if modules have loaded + assert js_globals.Modules.History.type() is not None + assert js_globals.Modules.Latex.type() is not None + assert js_globals.Modules.ObjectsCommon.type() is not None + assert js_globals.Modules.Canvas.type() is not None + assert js_globals.Modules.IO.type() is not None + assert js_globals.Modules.Objects.type() is not None + assert js_globals.Modules.Preferences.type() is not None \ No newline at end of file