Skip to content

Commit

Permalink
Merge "[INTERNAL][FIX] Component_containedInLibrary: Fix unstable Tests"
Browse files Browse the repository at this point in the history
  • Loading branch information
Thodd authored and Gerrit Code Review committed Jul 29, 2021
2 parents a933d68 + 8cd20c4 commit 63e31c2
Showing 1 changed file with 11 additions and 14 deletions.
Expand Up @@ -18,8 +18,8 @@ sap.ui.define([
"gav": "<GAV>",
"libraries": [],
"components": {
"sap.ui.documentation.sdk": {
"library": "sap.ui.documentation",
"sap.ui.test.componentContainedInLibrary.Comp1": {
"library": "sap.ui.test.componentContainedInLibrary",
"manifestHints": {
"dependencies": {
"libs": {
Expand All @@ -30,9 +30,9 @@ sap.ui.define([
}
}
},
"sap.ui.documentation.sdk.cookieSettingsDialog": {
"sap.ui.test.componentContainedInLibrary.Comp2": {
"hasOwnPreload": true,
"library": "sap.ui.documentation",
"library": "sap.ui.test.componentContainedInLibrary",
"manifestHints": {
"dependencies": {
"libs": {
Expand All @@ -55,35 +55,32 @@ sap.ui.define([
var loadPreload = this.stub(sap.ui.loader._, "loadJSResourceAsync").returns(success);

return Component.create({
name: "sap.ui.documentation.sdk",
name: "sap.ui.test.componentContainedInLibrary.Comp1",
manifest: false
}).catch(noop).finally(function() {
assert.ok(loadLibs.calledWith(
sinon.match.array.contains(["sap.m", "sap.ui.core", "sap.ui.layout", "sap.ui.documentation"])),
sinon.match.array.contains(["sap.m", "sap.ui.core", "sap.ui.layout", "sap.ui.test.componentContainedInLibrary"])),
"...then that library should be implicitly loaded");
assert.ok(
loadPreload.neverCalledWith(sinon.match(/documentation\/sdk\/Component-preload\.js$/)),
loadPreload.neverCalledWith(sinon.match(/sap\/ui\/test\/componentContainedInLibrary\/Comp1\/Component-preload\.js$/)),
"...then no Component-preload file should be requested for the component");
});
});

// Skip reason: The tests fail consistently in Voters and locally.
// We suspect timing differences introduced with change #5331206.
// We first try to stabelize the voters and then find the actual root cause.
QUnit.skip("and bundled separately...", function(assert) {
QUnit.test("and bundled separately...", function(assert) {
var success = Promise.resolve();
var loadLibs = this.stub(sap.ui.getCore(), "loadLibraries").returns(success);
var loadPreload = this.stub(sap.ui.loader._, "loadJSResourceAsync").returns(success);

return Component.create({
name: "sap.ui.documentation.sdk.cookieSettingsDialog",
name: "sap.ui.test.componentContainedInLibrary.Comp2",
manifest: false
}).catch(noop).finally(function() {
assert.ok(
loadLibs.neverCalledWith(sinon.match.array.contains(["sap.ui.documentation"])),
loadLibs.neverCalledWith(sinon.match.array.contains(["sap.ui.test.componentContainedInLibrary"])),
"...then the containing library should not be loaded");
assert.ok(
loadPreload.calledWith(sinon.match(/documentation\/sdk\/cookieSettingsDialog\/Component-preload\.js$/)),
loadPreload.calledWith(sinon.match(/sap\/ui\/test\/componentContainedInLibrary\/Comp2\/Component-preload\.js$/)),
"...then a Component-preload file should be requested for the component");
});
});
Expand Down

0 comments on commit 63e31c2

Please sign in to comment.