mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fix bug where failed OE expands could not be retried (#2780)
This commit is contained in:
@@ -753,4 +753,21 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
assert.equal(childNode.nodePath, objectExplorerExpandInfoRefresh.nodes[index].nodePath);
|
||||
});
|
||||
});
|
||||
|
||||
test('resolveTreeNodeChildren refreshes a node if it currently has an error', async () => {
|
||||
await objectExplorerService.createNewSession('MSSQL', connection);
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
|
||||
// If I call resolveTreeNodeChildren once, set an error on the node, and then call it again
|
||||
let tablesNodePath = 'testServerName/tables';
|
||||
let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, tablesNodePath, '', '', null, null, undefined, undefined);
|
||||
tablesNode.connection = connection;
|
||||
await objectExplorerService.resolveTreeNodeChildren(objectExplorerSession, tablesNode);
|
||||
sqlOEProvider.verify(x => x.refreshNode(TypeMoq.It.is(x => x.nodePath === tablesNodePath)), TypeMoq.Times.never());
|
||||
tablesNode.errorStateMessage = 'test error message';
|
||||
await objectExplorerService.resolveTreeNodeChildren(objectExplorerSession, tablesNode);
|
||||
|
||||
// Then refresh gets called on the node
|
||||
sqlOEProvider.verify(x => x.refreshNode(TypeMoq.It.is(x => x.nodePath === tablesNodePath)), TypeMoq.Times.once());
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user