From 8cd20c4eb1fb2bf607932710d8ffc14ae8314efc Mon Sep 17 00:00:00 2001 From: Thorsten Hochreuter Date: Wed, 28 Jul 2021 16:20:10 +0200 Subject: [PATCH] [INTERNAL][FIX] Component_containedInLibrary: Fix unstable Tests - Reactivates a previously skipped tests due to voter failures - Refactors the tests to be independent of sap.ui.documentation components Commit: 3ed03a2f5a3c818ce3aa6538c336554d805c1544 Change-Id: I343f8bbe8bcb15302459aa3c5c40644714ca449d --- .../Component_containedInLibrary.qunit.js | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/sap.ui.core/test/sap/ui/core/qunit/component/Component_containedInLibrary.qunit.js b/src/sap.ui.core/test/sap/ui/core/qunit/component/Component_containedInLibrary.qunit.js index 275da5ebf6ee..649781276994 100644 --- a/src/sap.ui.core/test/sap/ui/core/qunit/component/Component_containedInLibrary.qunit.js +++ b/src/sap.ui.core/test/sap/ui/core/qunit/component/Component_containedInLibrary.qunit.js @@ -18,8 +18,8 @@ sap.ui.define([ "gav": "", "libraries": [], "components": { - "sap.ui.documentation.sdk": { - "library": "sap.ui.documentation", + "sap.ui.test.componentContainedInLibrary.Comp1": { + "library": "sap.ui.test.componentContainedInLibrary", "manifestHints": { "dependencies": { "libs": { @@ -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": { @@ -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"); }); });