Skip to content

Commit ba60970

Browse files
authored
Refresh Component Types View right after Application Explorer View (#2025)
* Refresh Component Types View right after Application Explorer View This PR fixes #2010. Signed-off-by: Denis Golovin [email protected]
1 parent 24f1e69 commit ba60970

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/explorer.ts

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export class OpenShiftExplorer implements TreeDataProvider<OpenShiftObject>, Dis
101101
refresh(target?: OpenShiftObject): void {
102102
if (!target) {
103103
OpenShiftExplorer.odoctl.clearCache();
104+
commands.executeCommand('openshift.componentTypesView.refresh');
104105
}
105106
this.eventEmitter.fire(target);
106107
}

test/unit/openshift/cluster.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ suite('Openshift/Cluster', () => {
180180

181181
expect(status).equals(`Successfully logged in to '${testUrl}'`);
182182
expect(execStub).calledOnceWith(Command.odoLoginWithUsernamePassword(testUrl, testUser, password));
183-
expect(commandStub).calledOnceWith('setContext', 'isLoggedIn', true);
183+
expect(commandStub).calledWith('setContext', 'isLoggedIn', true);
184184
});
185185

186186
(keytar ? test : test.skip)('returns with no username set', async () => {
@@ -266,7 +266,7 @@ suite('Openshift/Cluster', () => {
266266

267267
expect(status).equals(`Successfully logged in to '${testUrl}'`);
268268
expect(execStub).calledOnceWith(Command.odoLoginWithToken(testUrl, token));
269-
expect(commandStub).calledOnceWith('setContext', 'isLoggedIn', true);
269+
expect(commandStub).calledWith('setContext', 'isLoggedIn', true);
270270
});
271271

272272
test('returns with no token set', async () => {
@@ -303,7 +303,7 @@ suite('Openshift/Cluster', () => {
303303

304304
expect(status).null;
305305
expect(execStub).calledOnceWith('odo logout');
306-
expect(commandStub).calledOnceWith('setContext', 'isLoggedIn', false);
306+
expect(commandStub).calledWith('setContext', 'isLoggedIn', false);
307307
});
308308

309309
test('logout and log back in works', async () => {

0 commit comments

Comments
 (0)