Skip to content

Commit

Permalink
chore(tests): update tests to work with IoC-Container
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorstenSuckow committed Dec 13, 2022
1 parent 3b3910d commit a6c8302
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/src/_issues_/feat/extjs-app-webmail#189.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* coon.js
* extjs-lib-core
* Copyright (C) 2021 Thorsten Suckow-Homberg https://github.com/coon-js/extjs-lib-core
* Copyright (C) 2021-2022 Thorsten Suckow-Homberg https://github.com/coon-js/extjs-lib-core
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -296,12 +296,15 @@ StartTest(t => {
mock = {
applicationUtil: {
loadPackages: function () {},
getCoonPackages: function () {}
getCoonPackages: function () {},
registerIoCBindings: function () {}
}
},
envSpy = t.spyOn(coon.core.Environment, "getPackages").and.callFake(() => manifestPackages),
coonPkgSpy = t.spyOn(mock.applicationUtil, "getCoonPackages").and.callFake(pkgs => pkgs),
loadPkgSpy = t.spyOn(mock.applicationUtil, "loadPackages").and.callFake(() => packageControllers);
loadPkgSpy = t.spyOn(mock.applicationUtil, "loadPackages").and.callFake(() => packageControllers),
registerIoCSpy = t.spyOn(mock.applicationUtil, "registerIoCBindings").and.callFake(() => {});


t.expect(await appPrototype.initPackagesAndConfiguration.call(mock, appConfPackages)).toBe(packageControllers);
t.isDeeply(loadPkgSpy.calls.mostRecent().args, [{
Expand Down Expand Up @@ -348,7 +351,7 @@ StartTest(t => {
"namespace": "conjoon.contacts"
});

[loadPkgSpy, envSpy, coonPkgSpy].map(spy => spy.remove());
[loadPkgSpy, envSpy, coonPkgSpy, registerIoCSpy].map(spy => spy.remove());
});

});
Expand Down

0 comments on commit a6c8302

Please sign in to comment.