mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 09:35:40 -05:00
Fix GetConnection (#19579)
This commit is contained in:
@@ -1634,20 +1634,6 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
return connections;
|
||||
}
|
||||
|
||||
public getConnection(uri: string): ConnectionProfile {
|
||||
const connections = this.getActiveConnections();
|
||||
if (connections) {
|
||||
for (let connection of connections) {
|
||||
let connectionUri = this.getConnectionUriFromId(connection.id);
|
||||
if (connectionUri === uri) {
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private getConnectionsInGroup(group: ConnectionProfileGroup): ConnectionProfile[] {
|
||||
const connections = [];
|
||||
if (group) {
|
||||
|
||||
@@ -781,8 +781,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
await connect(uri, options, true, profile);
|
||||
// invalid uri check.
|
||||
assert.strictEqual(connectionManagementService.getConnection(badString), undefined);
|
||||
let returnedProfile = connectionManagementService.getConnection(uri);
|
||||
assert.strictEqual(connectionManagementService.getConnectionProfile(badString), undefined);
|
||||
let returnedProfile = connectionManagementService.getConnectionProfile(uri);
|
||||
assert.strictEqual(returnedProfile.groupFullName, profile.groupFullName);
|
||||
assert.strictEqual(returnedProfile.groupId, profile.groupId);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user