Add Gerrit.getLoggedIn to JS API
Feature: Issue 3915
Change-Id: Ie54178b703011bda4c76b4d64bad75786acfcd8d
diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.html b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.html
index 959ba64..5936bee 100644
--- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.html
+++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.html
@@ -38,6 +38,11 @@
};
setup(function() {
+ stub('gr-rest-api-interface', {
+ getAccount: function() {
+ return Promise.resolve({name: 'Judy Hopps'});
+ },
+ })
element = fixture('basic');
errorStub = sinon.stub(console, 'error');
Gerrit.install(function(p) { plugin = p; }, '0.1',
@@ -125,5 +130,12 @@
assert(callback.notCalled);
});
+ test('getAccount', function(done) {
+ Gerrit.getLoggedIn().then(function(loggedIn) {
+ assert.isTrue(loggedIn);
+ done();
+ });
+ });
+
});
</script>