Fix issue with changing servers and tabs (#2126)
This commit is contained in:
@@ -199,6 +199,7 @@ describe('main/views/viewManager', () => {
|
||||
destroy: destroyFn,
|
||||
name: tab.name,
|
||||
urlTypeTuple: tab.urlTypeTuple,
|
||||
updateServerInfo: jest.fn(),
|
||||
tab,
|
||||
}));
|
||||
});
|
||||
@@ -288,11 +289,15 @@ describe('main/views/viewManager', () => {
|
||||
const view = {
|
||||
name: 'server1-tab1',
|
||||
tab: {
|
||||
server: {
|
||||
name: 'server-1',
|
||||
},
|
||||
name: 'server1-tab1',
|
||||
url: new URL('http://server1.com'),
|
||||
},
|
||||
urlTypeTuple: tuple('http://server1.com/', 'tab1'),
|
||||
destroy: jest.fn(),
|
||||
updateServerInfo: jest.fn(),
|
||||
};
|
||||
viewManager.currentView = 'server1-tab1';
|
||||
viewManager.views.set('server1-tab1', view);
|
||||
@@ -310,7 +315,6 @@ describe('main/views/viewManager', () => {
|
||||
},
|
||||
]);
|
||||
expect(viewManager.showByName).toHaveBeenCalledWith('server1-tab1');
|
||||
expect(viewManager.mainWindow.webContents.send).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should show initial if currentView has been removed', () => {
|
||||
@@ -322,6 +326,7 @@ describe('main/views/viewManager', () => {
|
||||
},
|
||||
urlTypeTuple: ['http://server.com/', 'tab1'],
|
||||
destroy: jest.fn(),
|
||||
updateServerInfo: jest.fn(),
|
||||
};
|
||||
viewManager.currentView = 'server1-tab1';
|
||||
viewManager.views.set('server1-tab1', view);
|
||||
@@ -338,7 +343,6 @@ describe('main/views/viewManager', () => {
|
||||
],
|
||||
},
|
||||
]);
|
||||
expect(viewManager.currentView).toBeUndefined();
|
||||
expect(viewManager.showInitial).toBeCalled();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user