summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Draebing <thomas.draebing@sap.com>2019-10-24 16:55:31 +0200
committerThomas Draebing <thomas.draebing@sap.com>2019-10-24 16:55:31 +0200
commit38f92d7d033922669dee17a3f14940b9bd37587d (patch)
treedb462b576471af954eadd05bc6acf0699a5ca1f2
parentc42ba05917095dc87a9f81b8d7473c37ecf03d8b (diff)
parentfdb9f8484669e4657320c2a774a6156b6bbb6c0b (diff)
Merge branch 'stable-2.16'
* stable-2.16: Add getConfig() method to plugin restApi interface Change-Id: I3ded71856e12947f9bcc7e428f67ca3ed19d0e1d
-rw-r--r--polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api.js4
-rw-r--r--polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api_test.html11
2 files changed, 14 insertions, 1 deletions
diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api.js b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api.js
index 76e200e56f..f85619e37f 100644
--- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api.js
+++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api.js
@@ -38,6 +38,10 @@
return getRestApi().getVersion();
};
+ GrPluginRestApi.prototype.getConfig = function() {
+ return getRestApi().getConfig();
+ };
+
GrPluginRestApi.prototype.invalidateReposCache = function() {
getRestApi().invalidateReposCache();
};
diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api_test.html b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api_test.html
index 59836214ea..7a59337771 100644
--- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api_test.html
+++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-rest-api_test.html
@@ -42,6 +42,7 @@ limitations under the License.
send: sendStub,
getLoggedIn: sandbox.stub(),
getVersion: sandbox.stub(),
+ getConfig: sandbox.stub(),
};
stub('gr-rest-api-interface', Object.keys(restApiStub).reduce((a, k) => {
a[k] = (...args) => restApiStub[k](...args);
@@ -133,12 +134,20 @@ limitations under the License.
});
});
- test('getConfig', () => {
+ test('getVersion', () => {
restApiStub.getVersion.returns(Promise.resolve('foo bar'));
return instance.getVersion().then(result => {
assert.isTrue(restApiStub.getVersion.calledOnce);
assert.equal(result, 'foo bar');
});
});
+
+ test('getConfig', () => {
+ restApiStub.getConfig.returns(Promise.resolve('foo bar'));
+ return instance.getConfig().then(result => {
+ assert.isTrue(restApiStub.getConfig.calledOnce);
+ assert.equal(result, 'foo bar');
+ });
+ });
});
</script>