mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 09:35:37 -05:00
Replace deprecated assert functions in test files. (#16945)
This commit is contained in:
@@ -120,9 +120,9 @@ suite('Account Management Service Tests:', () => {
|
||||
// ... The account list was updated
|
||||
state.eventVerifierUpdate.assertFiredWithVerify((params: UpdateAccountListEventParams | undefined) => {
|
||||
assert.ok(params);
|
||||
assert.equal(params!.providerId, hasAccountProvider.id);
|
||||
assert.strictEqual(params!.providerId, hasAccountProvider.id);
|
||||
assert.ok(Array.isArray(params!.accountList));
|
||||
assert.equal(params!.accountList.length, 1);
|
||||
assert.strictEqual(params!.accountList.length, 1);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -159,10 +159,10 @@ suite('Account Management Service Tests:', () => {
|
||||
// ... The account list change should have been fired
|
||||
state.eventVerifierUpdate.assertFiredWithVerify(param => {
|
||||
assert.ok(param);
|
||||
assert.equal(param!.providerId, hasAccountProvider.id);
|
||||
assert.strictEqual(param!.providerId, hasAccountProvider.id);
|
||||
assert.ok(Array.isArray(param!.accountList));
|
||||
assert.equal(param!.accountList.length, 1);
|
||||
assert.equal(param!.accountList[0], account);
|
||||
assert.strictEqual(param!.accountList.length, 1);
|
||||
assert.strictEqual(param!.accountList[0], account);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -199,10 +199,10 @@ suite('Account Management Service Tests:', () => {
|
||||
// ... The account list change should have been fired
|
||||
state.eventVerifierUpdate.assertFiredWithVerify(param => {
|
||||
assert.ok(param);
|
||||
assert.equal(param!.providerId, hasAccountProvider.id);
|
||||
assert.strictEqual(param!.providerId, hasAccountProvider.id);
|
||||
assert.ok(Array.isArray(param!.accountList));
|
||||
assert.equal(param!.accountList.length, 1);
|
||||
assert.equal(param!.accountList[0], account);
|
||||
assert.strictEqual(param!.accountList.length, 1);
|
||||
assert.strictEqual(param!.accountList[0], account);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -258,8 +258,8 @@ suite('Account Management Service Tests:', () => {
|
||||
.then(result => {
|
||||
// Then: The list should have the one account provider in it
|
||||
assert.ok(Array.isArray(result));
|
||||
assert.equal(result.length, 1);
|
||||
assert.equal(result[0], noAccountProvider);
|
||||
assert.strictEqual(result.length, 1);
|
||||
assert.strictEqual(result[0], noAccountProvider);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -272,7 +272,7 @@ suite('Account Management Service Tests:', () => {
|
||||
.then(result => {
|
||||
// Then: The results should be an empty array
|
||||
assert.ok(Array.isArray(result));
|
||||
assert.equal(result.length, 0);
|
||||
assert.strictEqual(result.length, 0);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -302,7 +302,7 @@ suite('Account Management Service Tests:', () => {
|
||||
.then(result => {
|
||||
// Then: I should get back an empty array
|
||||
assert.ok(Array.isArray(result));
|
||||
assert.equal(result.length, 0);
|
||||
assert.strictEqual(result.length, 0);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -319,7 +319,7 @@ suite('Account Management Service Tests:', () => {
|
||||
return ams.getAccountsForProvider(hasAccountProvider.id)
|
||||
.then(result => {
|
||||
// Then: I should get back the list of accounts
|
||||
assert.equal(result, accountList);
|
||||
assert.strictEqual(result, accountList);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -355,9 +355,9 @@ suite('Account Management Service Tests:', () => {
|
||||
// ... The updated account list event should have fired
|
||||
state.eventVerifierUpdate.assertFiredWithVerify((params: UpdateAccountListEventParams | undefined) => {
|
||||
assert.ok(params);
|
||||
assert.equal(params!.providerId, hasAccountProvider.id);
|
||||
assert.strictEqual(params!.providerId, hasAccountProvider.id);
|
||||
assert.ok(Array.isArray(params!.accountList));
|
||||
assert.equal(params!.accountList.length, 0);
|
||||
assert.strictEqual(params!.accountList.length, 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -490,9 +490,9 @@ suite('Account Management Service Tests:', () => {
|
||||
// ... The provider added event should have fired
|
||||
mocks.eventVerifierProviderAdded.assertFiredWithVerify((param: AccountProviderAddedEventParams | undefined) => {
|
||||
assert.ok(param);
|
||||
assert.equal(param!.addedProvider, noAccountProvider);
|
||||
assert.strictEqual(param!.addedProvider, noAccountProvider);
|
||||
assert.ok(Array.isArray(param!.initialAccounts));
|
||||
assert.equal(param!.initialAccounts.length, 0);
|
||||
assert.strictEqual(param!.initialAccounts.length, 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,10 +44,10 @@ suite('Account picker service tests', () => {
|
||||
|
||||
// Then:
|
||||
// ... All the events for the view models should be properly initialized
|
||||
assert.notEqual(service.addAccountCompleteEvent, undefined);
|
||||
assert.notEqual(service.addAccountErrorEvent, undefined);
|
||||
assert.notEqual(service.addAccountStartEvent, undefined);
|
||||
assert.notEqual(service.onAccountSelectionChangeEvent, undefined);
|
||||
assert.notStrictEqual(service.addAccountCompleteEvent, undefined);
|
||||
assert.notStrictEqual(service.addAccountErrorEvent, undefined);
|
||||
assert.notStrictEqual(service.addAccountStartEvent, undefined);
|
||||
assert.notStrictEqual(service.onAccountSelectionChangeEvent, undefined);
|
||||
|
||||
|
||||
// ... All the events should properly fire
|
||||
|
||||
@@ -281,7 +281,7 @@ suite('ConnectionDialogService tests', () => {
|
||||
Also openDialogAndWait returns the connection profile passed in */
|
||||
(connectionDialogService as any).handleDefaultOnConnect(testConnectionParams, connectionProfile);
|
||||
let result = await connectionPromise;
|
||||
assert.equal(result, connectionProfile);
|
||||
assert.strictEqual(result, connectionProfile);
|
||||
});
|
||||
|
||||
test('handleFillInConnectionInputs calls function on ConnectionController widget', async () => {
|
||||
@@ -292,7 +292,7 @@ suite('ConnectionDialogService tests', () => {
|
||||
await connectionDialogService.showDialog(mockConnectionManagementService.object, testConnectionParams, connectionProfile);
|
||||
await (connectionDialogService as any).handleFillInConnectionInputs(connectionProfile);
|
||||
let returnedModel = ((connectionDialogService as any)._connectionControllerMap['MSSQL'] as any)._model;
|
||||
assert.equal(returnedModel._groupName, 'testGroup');
|
||||
assert.strictEqual(returnedModel._groupName, 'testGroup');
|
||||
assert(called);
|
||||
});
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ suite('ConnectionDialogWidget tests', () => {
|
||||
});
|
||||
|
||||
test('renderBody should have attached a connection dialog body onto element', () => {
|
||||
assert.equal(element.childElementCount, 1);
|
||||
assert.equal(element.children[0].className, 'connection-dialog');
|
||||
assert.strictEqual(element.childElementCount, 1);
|
||||
assert.strictEqual(element.children[0].className, 'connection-dialog');
|
||||
});
|
||||
|
||||
test('updateConnectionProviders should update connection providers', () => {
|
||||
@@ -87,7 +87,7 @@ suite('ConnectionDialogWidget tests', () => {
|
||||
return getUniqueConnectionProvidersByNameMap(providerNameToDisplayMap);
|
||||
});
|
||||
connectionDialogWidget.updateConnectionProviders(providerDisplayNames, providerNameToDisplayMap);
|
||||
assert.equal(connectionDialogWidget.getDisplayNameFromProviderName('PGSQL'), providerNameToDisplayMap['PGSQL']);
|
||||
assert.strictEqual(connectionDialogWidget.getDisplayNameFromProviderName('PGSQL'), providerNameToDisplayMap['PGSQL']);
|
||||
});
|
||||
|
||||
test('setting newConnectionParams test for connectionDialogWidget', () => {
|
||||
@@ -109,7 +109,7 @@ suite('ConnectionDialogWidget tests', () => {
|
||||
return getUniqueConnectionProvidersByNameMap(providerNameToDisplayMap);
|
||||
});
|
||||
connectionDialogWidget.newConnectionParams = params;
|
||||
assert.equal(connectionDialogWidget.newConnectionParams, params);
|
||||
assert.strictEqual(connectionDialogWidget.newConnectionParams, params);
|
||||
});
|
||||
|
||||
test('open should call onInitDialog', async () => {
|
||||
@@ -176,8 +176,8 @@ suite('ConnectionDialogWidget tests', () => {
|
||||
});
|
||||
let providerDisplayName = 'Mock SQL Server';
|
||||
connectionDialogWidget.updateProvider(providerDisplayName);
|
||||
assert.equal(returnedDisplayName, providerDisplayName);
|
||||
assert.equal(returnedContainer.className, 'connection-provider-info');
|
||||
assert.strictEqual(returnedDisplayName, providerDisplayName);
|
||||
assert.strictEqual(returnedContainer.className, 'connection-provider-info');
|
||||
assert(called);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -299,8 +299,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
await connect(params.input.uri);
|
||||
let saveConnection = connectionManagementService.getConnectionProfile(params.input.uri);
|
||||
|
||||
assert.notEqual(saveConnection, undefined, `profile was not added to the connections`);
|
||||
assert.equal(saveConnection.serverName, connectionProfile.serverName, `Server names are different`);
|
||||
assert.notStrictEqual(saveConnection, undefined, `profile was not added to the connections`);
|
||||
assert.strictEqual(saveConnection.serverName, connectionProfile.serverName, `Server names are different`);
|
||||
await connectionManagementService.showConnectionDialog(params);
|
||||
verifyShowConnectionDialog(connectionProfile, params.connectionType, params.input.uri, false);
|
||||
});
|
||||
@@ -326,7 +326,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
test('getDefaultProviderId is MSSQL', () => {
|
||||
let defaultProvider = connectionManagementService.getDefaultProviderId();
|
||||
assert.equal(defaultProvider, 'MSSQL', `Default provider is not equal to MSSQL`);
|
||||
assert.strictEqual(defaultProvider, 'MSSQL', `Default provider is not equal to MSSQL`);
|
||||
});
|
||||
|
||||
/* Andresse 10/5/17 commented this test out since it was only working before my changes by the chance of how Promises work
|
||||
@@ -372,8 +372,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
await connect(uri, options);
|
||||
verifyOptions(options);
|
||||
assert.notEqual(paramsInOnConnectSuccess, undefined);
|
||||
assert.equal(paramsInOnConnectSuccess.connectionType, options.params.connectionType);
|
||||
assert.notStrictEqual(paramsInOnConnectSuccess, undefined);
|
||||
assert.strictEqual(paramsInOnConnectSuccess.connectionType, options.params.connectionType);
|
||||
});
|
||||
|
||||
test('connectAndSaveProfile should show not load the password', async () => {
|
||||
@@ -389,7 +389,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let options: IConnectionCompletionOptions = undefined;
|
||||
|
||||
await connect(uri, options);
|
||||
assert.equal(connectionManagementService.isProfileConnected(connectionProfile), true);
|
||||
assert.strictEqual(connectionManagementService.isProfileConnected(connectionProfile), true);
|
||||
});
|
||||
|
||||
test('failed connection should open the dialog if connection fails', async () => {
|
||||
@@ -414,8 +414,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
|
||||
let result = await connect(uri, options, false, connectionProfile, error, errorCode, errorCallStack);
|
||||
assert.equal(result.connected, expectedConnection);
|
||||
assert.equal(result.errorMessage, connectionResult.errorMessage);
|
||||
assert.strictEqual(result.connected, expectedConnection);
|
||||
assert.strictEqual(result.errorMessage, connectionResult.errorMessage);
|
||||
verifyShowFirewallRuleDialog(connectionProfile, false);
|
||||
verifyShowConnectionDialog(connectionProfile, ConnectionType.default, uri, true, connectionResult);
|
||||
});
|
||||
@@ -442,19 +442,19 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
|
||||
let result = await connect(uri, options, false, connectionProfile, error, errorCode, errorCallStack);
|
||||
assert.equal(result.connected, expectedConnection);
|
||||
assert.equal(result.errorMessage, connectionResult.errorMessage);
|
||||
assert.strictEqual(result.connected, expectedConnection);
|
||||
assert.strictEqual(result.errorMessage, connectionResult.errorMessage);
|
||||
verifyShowFirewallRuleDialog(connectionProfile, false);
|
||||
verifyShowConnectionDialog(connectionProfile, ConnectionType.default, uri, true, connectionResult, false);
|
||||
});
|
||||
|
||||
test('Accessors for event emitters should return emitter function', () => {
|
||||
let onAddConnectionProfile1 = connectionManagementService.onAddConnectionProfile;
|
||||
assert.equal(typeof (onAddConnectionProfile1), 'function');
|
||||
assert.strictEqual(typeof (onAddConnectionProfile1), 'function');
|
||||
let onDeleteConnectionProfile1 = connectionManagementService.onDeleteConnectionProfile;
|
||||
assert.equal(typeof (onDeleteConnectionProfile1), 'function');
|
||||
assert.strictEqual(typeof (onDeleteConnectionProfile1), 'function');
|
||||
let onConnect1 = connectionManagementService.onConnect;
|
||||
assert.equal(typeof (onConnect1), 'function');
|
||||
assert.strictEqual(typeof (onConnect1), 'function');
|
||||
});
|
||||
|
||||
test('onConnectionChangedNotification should call onConnectionChanged event', async () => {
|
||||
@@ -472,8 +472,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let changedConnectionInfo: azdata.ChangedConnectionInfo = { connectionUri: uri, connection: saveConnection };
|
||||
let called = false;
|
||||
connectionManagementService.onConnectionChanged((params: IConnectionParams) => {
|
||||
assert.equal(uri, params.connectionUri);
|
||||
assert.equal(saveConnection, params.connectionProfile);
|
||||
assert.strictEqual(uri, params.connectionUri);
|
||||
assert.strictEqual(saveConnection, params.connectionProfile);
|
||||
called = true;
|
||||
});
|
||||
connectionManagementService.onConnectionChangedNotification(0, changedConnectionInfo);
|
||||
@@ -487,7 +487,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let newGroupId = 'new_group_id';
|
||||
connectionStore.setup(x => x.changeGroupIdForConnection(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => Promise.resolve());
|
||||
await connectionManagementService.changeGroupIdForConnection(profile, newGroupId);
|
||||
assert.equal(profile.groupId, newGroupId);
|
||||
assert.strictEqual(profile.groupId, newGroupId);
|
||||
});
|
||||
|
||||
test('changeGroupIdForConnectionGroup should call changeGroupIdForConnectionGroup in ConnectionStore', async () => {
|
||||
@@ -530,7 +530,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
+ profile.serverName + '|userName:' + profile.userName;
|
||||
await connect(uri1, options, true, profile);
|
||||
let returnedProfile = connectionManagementService.findExistingConnection(profile);
|
||||
assert.equal(returnedProfile.getConnectionInfoId(), connectionInfoString);
|
||||
assert.strictEqual(returnedProfile.getConnectionInfoId(), connectionInfoString);
|
||||
});
|
||||
|
||||
test('deleteConnection should delete the connection properly', async () => {
|
||||
@@ -745,7 +745,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
await connect(uri, options);
|
||||
let result = await connectionManagementService.cancelEditorConnection(options.params.input);
|
||||
assert.equal(result, false);
|
||||
assert.strictEqual(result, false);
|
||||
assert(connectionManagementService.isConnected(uri));
|
||||
});
|
||||
|
||||
@@ -776,10 +776,10 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
await connect(uri, options, true, profile);
|
||||
// invalid uri check.
|
||||
assert.equal(connectionManagementService.getConnection(badString), undefined);
|
||||
assert.strictEqual(connectionManagementService.getConnection(badString), undefined);
|
||||
let returnedProfile = connectionManagementService.getConnection(uri);
|
||||
assert.equal(returnedProfile.groupFullName, profile.groupFullName);
|
||||
assert.equal(returnedProfile.groupId, profile.groupId);
|
||||
assert.strictEqual(returnedProfile.groupFullName, profile.groupFullName);
|
||||
assert.strictEqual(returnedProfile.groupId, profile.groupId);
|
||||
});
|
||||
|
||||
test('connectIfNotConnected should not try to connect with already connected profile', async () => {
|
||||
@@ -808,12 +808,12 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
await connect(uri, options, true, profile);
|
||||
let result = await connectionManagementService.connectIfNotConnected(profile, undefined, true);
|
||||
assert.equal(result, uri);
|
||||
assert.strictEqual(result, uri);
|
||||
});
|
||||
|
||||
test('getServerInfo should return undefined when given an invalid string', () => {
|
||||
let badString = 'bad_string';
|
||||
assert.equal(connectionManagementService.getServerInfo(badString), undefined);
|
||||
assert.strictEqual(connectionManagementService.getServerInfo(badString), undefined);
|
||||
});
|
||||
|
||||
test('getConnectionString should get connection string of connectionId', async () => {
|
||||
@@ -843,7 +843,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
let getConnectionResult = await connectionManagementService.getConnectionString(badString);
|
||||
// test for invalid profile id
|
||||
assert.equal(getConnectionResult, undefined);
|
||||
assert.strictEqual(getConnectionResult, undefined);
|
||||
await connect(uri, options, true, profile);
|
||||
let currentConnections = connectionManagementService.getConnections(true);
|
||||
let profileId = currentConnections[0].id;
|
||||
@@ -923,7 +923,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
});
|
||||
await connect(uri, options, true, profile);
|
||||
let result = await connectionManagementService.buildConnectionInfo(testConnectionString, providerName);
|
||||
assert.equal(result.options, options);
|
||||
assert.strictEqual(result.options, options);
|
||||
});
|
||||
|
||||
test('removeConnectionProfileCredentials should return connection profile without password', () => {
|
||||
@@ -934,7 +934,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
return <ConnectionProfile>profileWithoutPass;
|
||||
});
|
||||
let clearedProfile = connectionManagementService.removeConnectionProfileCredentials(profile);
|
||||
assert.equal(clearedProfile.password, undefined);
|
||||
assert.strictEqual(clearedProfile.password, undefined);
|
||||
});
|
||||
|
||||
test('getConnectionProfileById should return profile when given profileId', async () => {
|
||||
@@ -962,13 +962,13 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
showFirewallRuleOnError: true
|
||||
};
|
||||
let result = await connect(uri, options, true, profile);
|
||||
assert.equal(result.connected, true);
|
||||
assert.equal(connectionManagementService.getConnectionProfileById(badString), undefined);
|
||||
assert.strictEqual(result.connected, true);
|
||||
assert.strictEqual(connectionManagementService.getConnectionProfileById(badString), undefined);
|
||||
let currentConnections = connectionManagementService.getConnections(true);
|
||||
let profileId = currentConnections[0].id;
|
||||
let returnedProfile = connectionManagementService.getConnectionProfileById(profileId);
|
||||
assert.equal(returnedProfile.groupFullName, profile.groupFullName);
|
||||
assert.equal(returnedProfile.groupId, profile.groupId);
|
||||
assert.strictEqual(returnedProfile.groupFullName, profile.groupFullName);
|
||||
assert.strictEqual(returnedProfile.groupId, profile.groupId);
|
||||
});
|
||||
|
||||
test('Edit Connection - Changing connection profile name for same URI should persist after edit', async () => {
|
||||
@@ -1001,7 +1001,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
newProfile.connectionName = newname;
|
||||
options.params.isEditConnection = true;
|
||||
await connect(uri1, options, true, newProfile);
|
||||
assert.equal(connectionManagementService.getConnectionProfile(uri1).connectionName, newname);
|
||||
assert.strictEqual(connectionManagementService.getConnectionProfile(uri1).connectionName, newname);
|
||||
});
|
||||
|
||||
test('Edit Connection - Connecting a different URI with same profile via edit should not change profile ID.', async () => {
|
||||
@@ -1035,7 +1035,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
await connect(uri2, options, true, profile);
|
||||
let uri1info = connectionManagementService.getConnectionInfo(uri1);
|
||||
let uri2info = connectionManagementService.getConnectionInfo(uri2);
|
||||
assert.equal(uri1info.connectionProfile.id, uri2info.connectionProfile.id);
|
||||
assert.strictEqual(uri1info.connectionProfile.id, uri2info.connectionProfile.id);
|
||||
});
|
||||
|
||||
|
||||
@@ -1058,8 +1058,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
|
||||
let result = await connect(uri, options, false, connectionProfile, error, errorCode);
|
||||
assert.equal(result.connected, expectedConnection);
|
||||
assert.equal(result.errorMessage, expectedError);
|
||||
assert.strictEqual(result.connected, expectedConnection);
|
||||
assert.strictEqual(result.errorMessage, expectedError);
|
||||
verifyShowFirewallRuleDialog(connectionProfile, true);
|
||||
});
|
||||
|
||||
@@ -1089,8 +1089,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
|
||||
let result = await connect(uri, options, false, connectionProfile, error, errorCode, errorCallStack);
|
||||
assert.equal(result.connected, expectedConnection);
|
||||
assert.equal(result.errorMessage, connectionResult.errorMessage);
|
||||
assert.strictEqual(result.connected, expectedConnection);
|
||||
assert.strictEqual(result.errorMessage, connectionResult.errorMessage);
|
||||
verifyShowFirewallRuleDialog(connectionProfile, false);
|
||||
verifyShowConnectionDialog(connectionProfile, ConnectionType.default, uri, true, connectionResult, false);
|
||||
});
|
||||
@@ -1101,25 +1101,25 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
test('getConnectionIconId should return undefined as there is no mementoObj service', () => {
|
||||
let connectionId = 'connection:connectionId';
|
||||
assert.equal(connectionManagementService.getConnectionIconId(connectionId), undefined);
|
||||
assert.strictEqual(connectionManagementService.getConnectionIconId(connectionId), undefined);
|
||||
});
|
||||
|
||||
test('getAdvancedProperties should return a list of properties for connectionManagementService', () => {
|
||||
let propertyNames = ['connectionName', 'serverName', 'databaseName', 'userName', 'authenticationType', 'password'];
|
||||
let advancedProperties = connectionManagementService.getAdvancedProperties();
|
||||
assert.equal(propertyNames[0], advancedProperties[0].name);
|
||||
assert.equal(propertyNames[1], advancedProperties[1].name);
|
||||
assert.equal(propertyNames[2], advancedProperties[2].name);
|
||||
assert.equal(propertyNames[3], advancedProperties[3].name);
|
||||
assert.equal(propertyNames[4], advancedProperties[4].name);
|
||||
assert.equal(propertyNames[5], advancedProperties[5].name);
|
||||
assert.strictEqual(propertyNames[0], advancedProperties[0].name);
|
||||
assert.strictEqual(propertyNames[1], advancedProperties[1].name);
|
||||
assert.strictEqual(propertyNames[2], advancedProperties[2].name);
|
||||
assert.strictEqual(propertyNames[3], advancedProperties[3].name);
|
||||
assert.strictEqual(propertyNames[4], advancedProperties[4].name);
|
||||
assert.strictEqual(propertyNames[5], advancedProperties[5].name);
|
||||
});
|
||||
|
||||
test('saveProfileGroup should return groupId from connection group', async () => {
|
||||
let newConnectionGroup = createConnectionGroup(connectionProfile.groupId);
|
||||
connectionStore.setup(x => x.saveProfileGroup(TypeMoq.It.isAny())).returns(() => Promise.resolve(connectionProfile.groupId));
|
||||
let result = await connectionManagementService.saveProfileGroup(newConnectionGroup);
|
||||
assert.equal(result, connectionProfile.groupId);
|
||||
assert.strictEqual(result, connectionProfile.groupId);
|
||||
});
|
||||
|
||||
test('editGroup should fire onAddConnectionProfile', async () => {
|
||||
@@ -1137,10 +1137,10 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let testUri = 'connection:';
|
||||
let formattedUri = 'connection:connectionId';
|
||||
let badUri = 'bad_uri';
|
||||
assert.equal(formattedUri, connectionManagementService.getFormattedUri(testUri, connectionProfile));
|
||||
assert.equal(formattedUri, connectionManagementService.getFormattedUri(formattedUri, connectionProfile));
|
||||
assert.strictEqual(formattedUri, connectionManagementService.getFormattedUri(testUri, connectionProfile));
|
||||
assert.strictEqual(formattedUri, connectionManagementService.getFormattedUri(formattedUri, connectionProfile));
|
||||
// test for invalid URI
|
||||
assert.equal(badUri, connectionManagementService.getFormattedUri(badUri, connectionProfile));
|
||||
assert.strictEqual(badUri, connectionManagementService.getFormattedUri(badUri, connectionProfile));
|
||||
});
|
||||
|
||||
test('failed firewall rule connection and failed during open firewall rule should open the firewall rule dialog and connection dialog with error', async () => {
|
||||
@@ -1169,8 +1169,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
|
||||
let result = await connect(uri, options, false, connectionProfile, error, errorCode, errorCallStack);
|
||||
assert.equal(result.connected, expectedConnection);
|
||||
assert.equal(result.errorMessage, connectionResult.errorMessage);
|
||||
assert.strictEqual(result.connected, expectedConnection);
|
||||
assert.strictEqual(result.errorMessage, connectionResult.errorMessage);
|
||||
verifyShowFirewallRuleDialog(connectionProfile, true);
|
||||
verifyShowConnectionDialog(connectionProfile, ConnectionType.default, uri, true, connectionResult, true);
|
||||
});
|
||||
@@ -1201,7 +1201,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
|
||||
let result = await connect(uri, options, false, connectionProfile, error, errorCode, errorCallStack);
|
||||
assert.equal(result, undefined);
|
||||
assert.strictEqual(result, undefined);
|
||||
verifyShowFirewallRuleDialog(connectionProfile, true);
|
||||
verifyShowConnectionDialog(connectionProfile, ConnectionType.default, uri, true, connectionResult, false);
|
||||
});
|
||||
@@ -1225,8 +1225,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
|
||||
let result = await connect(uri, options, false, connectionProfileWithEmptyUnsavedPassword);
|
||||
assert.equal(result.connected, expectedConnection);
|
||||
assert.equal(result.errorMessage, connectionResult.errorMessage);
|
||||
assert.strictEqual(result.connected, expectedConnection);
|
||||
assert.strictEqual(result.errorMessage, connectionResult.errorMessage);
|
||||
verifyShowConnectionDialog(connectionProfileWithEmptyUnsavedPassword, ConnectionType.default, uri, true, connectionResult);
|
||||
verifyShowFirewallRuleDialog(connectionProfile, false);
|
||||
});
|
||||
@@ -1250,8 +1250,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
|
||||
let result = await connect(uri, options, false, connectionProfileWithEmptySavedPassword);
|
||||
assert.equal(result.connected, expectedConnection);
|
||||
assert.equal(result.errorMessage, connectionResult.errorMessage);
|
||||
assert.strictEqual(result.connected, expectedConnection);
|
||||
assert.strictEqual(result.errorMessage, connectionResult.errorMessage);
|
||||
verifyShowConnectionDialog(connectionProfileWithEmptySavedPassword, ConnectionType.default, uri, true, connectionResult, false);
|
||||
});
|
||||
|
||||
@@ -1286,8 +1286,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
|
||||
let result = await connect(uri, options, false, connectionProfileWithEmptySavedPassword);
|
||||
assert.equal(result.connected, expectedConnection);
|
||||
assert.equal(result.errorMessage, connectionResult.errorMessage);
|
||||
assert.strictEqual(result.connected, expectedConnection);
|
||||
assert.strictEqual(result.errorMessage, connectionResult.errorMessage);
|
||||
verifyShowConnectionDialog(connectionProfileWithEmptySavedPassword, ConnectionType.editor, uri, true, connectionResult, false);
|
||||
});
|
||||
|
||||
@@ -1383,8 +1383,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let pgsqlId = 'PGSQL';
|
||||
let mssqlProperties = connectionManagementService.getProviderProperties('MSSQL');
|
||||
let pgsqlProperties = connectionManagementService.getProviderProperties('PGSQL');
|
||||
assert.equal(mssqlProperties.providerId, mssqlId);
|
||||
assert.equal(pgsqlProperties.providerId, pgsqlId);
|
||||
assert.strictEqual(mssqlProperties.providerId, mssqlId);
|
||||
assert.strictEqual(pgsqlProperties.providerId, pgsqlId);
|
||||
});
|
||||
|
||||
test('doChangeLanguageFlavor should throw on unknown provider', () => {
|
||||
@@ -1404,9 +1404,9 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let called = false;
|
||||
connectionManagementService.onLanguageFlavorChanged((changeParams: azdata.DidChangeLanguageFlavorParams) => {
|
||||
called = true;
|
||||
assert.equal(changeParams.uri, uri);
|
||||
assert.equal(changeParams.language, language);
|
||||
assert.equal(changeParams.flavor, flavor);
|
||||
assert.strictEqual(changeParams.uri, uri);
|
||||
assert.strictEqual(changeParams.language, language);
|
||||
assert.strictEqual(changeParams.flavor, flavor);
|
||||
});
|
||||
connectionManagementService.doChangeLanguageFlavor(uri, language, flavor);
|
||||
assert.ok(called, 'expected onLanguageFlavorChanged event to be sent');
|
||||
@@ -1416,17 +1416,17 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
test('getUniqueConnectionProvidersByNameMap should return non CMS providers', () => {
|
||||
let nameToDisplayNameMap: { [providerDisplayName: string]: string } = { 'MSSQL': 'SQL Server', 'MSSQL-CMS': 'SQL Server' };
|
||||
let providerNames = Object.keys(connectionManagementService.getUniqueConnectionProvidersByNameMap(nameToDisplayNameMap));
|
||||
assert.equal(providerNames.length, 1);
|
||||
assert.equal(providerNames[0], 'MSSQL');
|
||||
assert.strictEqual(providerNames.length, 1);
|
||||
assert.strictEqual(providerNames[0], 'MSSQL');
|
||||
});
|
||||
|
||||
test('providerNameToDisplayNameMap should return all providers', () => {
|
||||
let expectedNames = ['MSSQL', 'PGSQL', 'FAKE'];
|
||||
let providerNames = Object.keys(connectionManagementService.providerNameToDisplayNameMap);
|
||||
assert.equal(providerNames.length, 3);
|
||||
assert.equal(providerNames[0], expectedNames[0]);
|
||||
assert.equal(providerNames[1], expectedNames[1]);
|
||||
assert.equal(providerNames[2], expectedNames[2]);
|
||||
assert.strictEqual(providerNames.length, 3);
|
||||
assert.strictEqual(providerNames[0], expectedNames[0]);
|
||||
assert.strictEqual(providerNames[1], expectedNames[1]);
|
||||
assert.strictEqual(providerNames[2], expectedNames[2]);
|
||||
});
|
||||
|
||||
test('ensureDefaultLanguageFlavor should send event if uri is not connected', () => {
|
||||
@@ -1455,7 +1455,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
await connect(uri, options);
|
||||
called = false; //onLanguageFlavorChanged is called when connecting, must set back to false.
|
||||
connectionManagementService.ensureDefaultLanguageFlavor(uri);
|
||||
assert.equal(called, false, 'do not expect flavor change to be called');
|
||||
assert.strictEqual(called, false, 'do not expect flavor change to be called');
|
||||
});
|
||||
|
||||
test('getConnectionId returns the URI associated with a connection that has had its database filled in', async () => {
|
||||
@@ -1475,8 +1475,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
// Then the retrieved URIs should match the one on the connection
|
||||
let expectedUri = Utils.generateUri(connectionProfileWithoutDb);
|
||||
assert.equal(actualUriWithDb, expectedUri);
|
||||
assert.equal(actualUriWithoutDb, expectedUri);
|
||||
assert.strictEqual(actualUriWithDb, expectedUri);
|
||||
assert.strictEqual(actualUriWithoutDb, expectedUri);
|
||||
});
|
||||
|
||||
test('list and change database tests', async () => {
|
||||
@@ -1508,11 +1508,11 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
mssqlConnectionProvider.setup(x => x.changeDatabase(ownerUri, newDbName)).returns(() => changeDatabasesThenable(ownerUri, newDbName));
|
||||
await connect(ownerUri, undefined, false, connectionProfileWithoutDb);
|
||||
let listDatabasesResult = await connectionManagementService.listDatabases(ownerUri);
|
||||
assert.equal(listDatabasesResult.databaseNames.length, 1);
|
||||
assert.equal(listDatabasesResult.databaseNames[0], dbName);
|
||||
assert.strictEqual(listDatabasesResult.databaseNames.length, 1);
|
||||
assert.strictEqual(listDatabasesResult.databaseNames[0], dbName);
|
||||
let changeDatabaseResults = await connectionManagementService.changeDatabase(ownerUri, newDbName);
|
||||
assert(changeDatabaseResults);
|
||||
assert.equal(newDbName, connectionManagementService.getConnectionProfile(ownerUri).databaseName);
|
||||
assert.strictEqual(newDbName, connectionManagementService.getConnectionProfile(ownerUri).databaseName);
|
||||
});
|
||||
|
||||
test('list and change database tests for invalid uris', async () => {
|
||||
@@ -1527,7 +1527,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
test('getTabColorForUri returns undefined when there is no connection for the given URI', () => {
|
||||
let connectionManagementService = createConnectionManagementService();
|
||||
let color = connectionManagementService.getTabColorForUri('invalidUri');
|
||||
assert.equal(color, undefined);
|
||||
assert.strictEqual(color, undefined);
|
||||
});
|
||||
|
||||
test('getTabColorForUri returns the group color corresponding to the connection for a URI', async () => {
|
||||
@@ -1540,7 +1540,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let uri = 'testUri';
|
||||
await connect(uri);
|
||||
let tabColor = connectionManagementService.getTabColorForUri(uri);
|
||||
assert.equal(tabColor, expectedColor);
|
||||
assert.strictEqual(tabColor, expectedColor);
|
||||
});
|
||||
|
||||
test('getConnectionCredentials returns the credentials dictionary for an active connection profile', async () => {
|
||||
@@ -1550,7 +1550,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
connectionStatusManager.addConnection(profile, 'test_uri');
|
||||
(connectionManagementService as any)._connectionStatusManager = connectionStatusManager;
|
||||
let credentials = await connectionManagementService.getConnectionCredentials(profile.id);
|
||||
assert.equal(credentials['password'], profile.options['password']);
|
||||
assert.strictEqual(credentials['password'], profile.options['password']);
|
||||
});
|
||||
|
||||
test('getConnectionCredentials returns the credentials dictionary for a recently used connection profile', async () => {
|
||||
@@ -1569,13 +1569,13 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
testInstantiationService.stub(IStorageService, new TestStorageService());
|
||||
testInstantiationService.stubCreateInstance(ConnectionStore, connectionStoreMock.object);
|
||||
const connectionManagementService = new ConnectionManagementService(undefined, testInstantiationService, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService());
|
||||
assert.equal(profile.password, '', 'Profile should not have password initially');
|
||||
assert.equal(profile.options['password'], '', 'Profile options should not have password initially');
|
||||
assert.strictEqual(profile.password, '', 'Profile should not have password initially');
|
||||
assert.strictEqual(profile.options['password'], '', 'Profile options should not have password initially');
|
||||
// Check for invalid profile id
|
||||
let badCredentials = await connectionManagementService.getConnectionCredentials(badString);
|
||||
assert.equal(badCredentials, undefined);
|
||||
assert.strictEqual(badCredentials, undefined);
|
||||
let credentials = await connectionManagementService.getConnectionCredentials(profile.id);
|
||||
assert.equal(credentials['password'], test_password);
|
||||
assert.strictEqual(credentials['password'], test_password);
|
||||
});
|
||||
|
||||
test('getConnectionCredentials returns the credentials dictionary for a saved connection profile', async () => {
|
||||
@@ -1599,10 +1599,10 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
testInstantiationService.stubCreateInstance(ConnectionStore, connectionStoreMock.object);
|
||||
|
||||
const connectionManagementService = new ConnectionManagementService(undefined, testInstantiationService, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService());
|
||||
assert.equal(profile.password, '', 'Profile should not have password initially');
|
||||
assert.equal(profile.options['password'], '', 'Profile options should not have password initially');
|
||||
assert.strictEqual(profile.password, '', 'Profile should not have password initially');
|
||||
assert.strictEqual(profile.options['password'], '', 'Profile options should not have password initially');
|
||||
let credentials = await connectionManagementService.getConnectionCredentials(profile.id);
|
||||
assert.equal(credentials['password'], test_password);
|
||||
assert.strictEqual(credentials['password'], test_password);
|
||||
});
|
||||
|
||||
test('getConnectionUriFromId returns a URI of an active connection with the given id', () => {
|
||||
@@ -1617,11 +1617,11 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let foundUri = connectionManagementService.getConnectionUriFromId(profile.id);
|
||||
|
||||
// Then the returned URI matches the connection's original URI
|
||||
assert.equal(foundUri, uri);
|
||||
assert.strictEqual(foundUri, uri);
|
||||
});
|
||||
|
||||
test('provider is registered and working', () => {
|
||||
assert.equal(connectionManagementService.providerRegistered('MSSQL'), true);
|
||||
assert.strictEqual(connectionManagementService.providerRegistered('MSSQL'), true);
|
||||
});
|
||||
|
||||
test('getConectionUriFromId returns undefined if the given connection is not active', () => {
|
||||
@@ -1635,7 +1635,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let foundUri = connectionManagementService.getConnectionUriFromId('different_id');
|
||||
|
||||
// Then undefined is returned
|
||||
assert.equal(foundUri, undefined);
|
||||
assert.strictEqual(foundUri, undefined);
|
||||
});
|
||||
|
||||
test('addSavedPassword fills in Azure access tokens for Azure accounts', async () => {
|
||||
@@ -1689,8 +1689,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let profileWithCredentials = await connectionManagementService.addSavedPassword(azureConnectionProfile);
|
||||
|
||||
// Then the returned profile has the account token set
|
||||
assert.equal(profileWithCredentials.userName, azureConnectionProfile.userName);
|
||||
assert.equal(profileWithCredentials.options['azureAccountToken'], testToken);
|
||||
assert.strictEqual(profileWithCredentials.userName, azureConnectionProfile.userName);
|
||||
assert.strictEqual(profileWithCredentials.options['azureAccountToken'], testToken);
|
||||
});
|
||||
|
||||
test('addSavedPassword fills in Azure access token for selected tenant', async () => {
|
||||
@@ -1743,8 +1743,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let profileWithCredentials = await connectionManagementService.addSavedPassword(azureConnectionProfile);
|
||||
|
||||
// Then the returned profile has the account token set corresponding to the requested tenant
|
||||
assert.equal(profileWithCredentials.userName, azureConnectionProfile.userName);
|
||||
assert.equal(profileWithCredentials.options['azureAccountToken'], returnedToken.token);
|
||||
assert.strictEqual(profileWithCredentials.userName, azureConnectionProfile.userName);
|
||||
assert.strictEqual(profileWithCredentials.options['azureAccountToken'], returnedToken.token);
|
||||
});
|
||||
|
||||
test('getConnections test', () => {
|
||||
@@ -1776,8 +1776,8 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
// dupe connections have been seeded the numbers below already reflected the de-duped results
|
||||
|
||||
const verifyConnections = (actualConnections: ConnectionProfile[], expectedConnectionIds: string[], scenario: string) => {
|
||||
assert.equal(actualConnections.length, expectedConnectionIds.length, 'incorrect number of connections returned, ' + scenario);
|
||||
assert.deepEqual(actualConnections.map(conn => conn.id).sort(), expectedConnectionIds.sort(), 'connections do not match expectation, ' + scenario);
|
||||
assert.strictEqual(actualConnections.length, expectedConnectionIds.length, 'incorrect number of connections returned, ' + scenario);
|
||||
assert.deepStrictEqual(actualConnections.map(conn => conn.id).sort(), expectedConnectionIds.sort(), 'connections do not match expectation, ' + scenario);
|
||||
};
|
||||
|
||||
// no parameter - default to false
|
||||
|
||||
@@ -37,14 +37,14 @@ suite('Dialog Pane Tests', () => {
|
||||
let modelViewId = 'test_content';
|
||||
let bootstrapCalls = 0;
|
||||
setupBootstrap((collection, moduleType, container, selectorString, params: DialogComponentParams, input, callbackSetModule) => {
|
||||
assert.equal(params.modelViewId, modelViewId);
|
||||
assert.strictEqual(params.modelViewId, modelViewId);
|
||||
bootstrapCalls++;
|
||||
});
|
||||
dialog.content = modelViewId;
|
||||
const themeService = new TestThemeService();
|
||||
let dialogPane = new DialogPane(dialog.title, dialog.content, () => undefined, workbenchInstantiationService(), themeService, undefined);
|
||||
dialogPane.createBody(container);
|
||||
assert.equal(bootstrapCalls, 1);
|
||||
assert.strictEqual(bootstrapCalls, 1);
|
||||
});
|
||||
|
||||
test('Creating a pane from content with a single tab initializes without showing tabs', () => {
|
||||
@@ -52,14 +52,14 @@ suite('Dialog Pane Tests', () => {
|
||||
let modelViewId = 'test_content';
|
||||
let bootstrapCalls = 0;
|
||||
setupBootstrap((collection, moduleType, container, selectorString, params: DialogComponentParams, input, callbackSetModule) => {
|
||||
assert.equal(params.modelViewId, modelViewId);
|
||||
assert.strictEqual(params.modelViewId, modelViewId);
|
||||
bootstrapCalls++;
|
||||
});
|
||||
dialog.content = [new DialogTab('', modelViewId)];
|
||||
const themeService = new TestThemeService();
|
||||
let dialogPane = new DialogPane(dialog.title, dialog.content, () => undefined, workbenchInstantiationService(), themeService, false);
|
||||
dialogPane.createBody(container);
|
||||
assert.equal(bootstrapCalls, 1);
|
||||
assert.strictEqual(bootstrapCalls, 1);
|
||||
});
|
||||
|
||||
test('Dialog validation gets set based on the validity of the model view content', () => {
|
||||
@@ -83,21 +83,21 @@ suite('Dialog Pane Tests', () => {
|
||||
// If I set tab 2's validation to false
|
||||
validationCallbacks[1](false);
|
||||
// Then the whole dialog's validation is false
|
||||
assert.equal(dialog.valid, false);
|
||||
assert.equal(validityChanges.length, 1);
|
||||
assert.equal(validityChanges[0], false);
|
||||
assert.strictEqual(dialog.valid, false);
|
||||
assert.strictEqual(validityChanges.length, 1);
|
||||
assert.strictEqual(validityChanges[0], false);
|
||||
// If I then set it back to true
|
||||
validationCallbacks[1](true);
|
||||
// Then the whole dialog's validation is true
|
||||
assert.equal(dialog.valid, true);
|
||||
assert.equal(validityChanges.length, 2);
|
||||
assert.equal(validityChanges[1], true);
|
||||
assert.strictEqual(dialog.valid, true);
|
||||
assert.strictEqual(validityChanges.length, 2);
|
||||
assert.strictEqual(validityChanges[1], true);
|
||||
// If I set tab 1's validation to false
|
||||
validationCallbacks[0](false);
|
||||
// Then the whole dialog's validation is false
|
||||
assert.equal(dialog.valid, false);
|
||||
assert.equal(validityChanges.length, 3);
|
||||
assert.equal(validityChanges[2], false);
|
||||
assert.strictEqual(dialog.valid, false);
|
||||
assert.strictEqual(validityChanges.length, 3);
|
||||
assert.strictEqual(validityChanges[2], false);
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
|
||||
@@ -32,7 +32,7 @@ suite('Insights Dialog Model Tests', () => {
|
||||
];
|
||||
let result = insightsDialogModel.getListResources(0, 1);
|
||||
for (let resource of result) {
|
||||
assert.equal(resource.stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(resource.stateColor, 'green', 'always Condition did not return val as expected');
|
||||
}
|
||||
|
||||
label.state = [
|
||||
@@ -52,9 +52,9 @@ suite('Insights Dialog Model Tests', () => {
|
||||
['label3', 'value3']
|
||||
];
|
||||
result = insightsDialogModel.getListResources(0, 1);
|
||||
assert.equal(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.equal(isUndefinedOrNull(result[1].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.equal(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(isUndefinedOrNull(result[1].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.strictEqual(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
|
||||
label.state = [
|
||||
{
|
||||
@@ -80,9 +80,9 @@ suite('Insights Dialog Model Tests', () => {
|
||||
['label3', 'value3']
|
||||
];
|
||||
result = insightsDialogModel.getListResources(0, 1);
|
||||
assert.equal(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.equal(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.equal(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
|
||||
label.state = [
|
||||
{
|
||||
@@ -108,9 +108,9 @@ suite('Insights Dialog Model Tests', () => {
|
||||
['label3', 'value3']
|
||||
];
|
||||
result = insightsDialogModel.getListResources(0, 1);
|
||||
assert.equal(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.equal(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.equal(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
|
||||
label.state = [
|
||||
{
|
||||
@@ -136,9 +136,9 @@ suite('Insights Dialog Model Tests', () => {
|
||||
['label3', 'value3']
|
||||
];
|
||||
result = insightsDialogModel.getListResources(0, 1);
|
||||
assert.equal(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.equal(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.equal(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
|
||||
label.state = [
|
||||
{
|
||||
@@ -164,9 +164,9 @@ suite('Insights Dialog Model Tests', () => {
|
||||
['label3', 'value3']
|
||||
];
|
||||
result = insightsDialogModel.getListResources(0, 1);
|
||||
assert.equal(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.equal(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.equal(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
|
||||
label.state = [
|
||||
{
|
||||
@@ -192,9 +192,9 @@ suite('Insights Dialog Model Tests', () => {
|
||||
['label3', 'value3']
|
||||
];
|
||||
result = insightsDialogModel.getListResources(0, 1);
|
||||
assert.equal(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.equal(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.equal(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[1].stateColor, 'red', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(isUndefinedOrNull(result[2].stateColor), true, 'always Condition did not return val as expected');
|
||||
|
||||
label.state = [
|
||||
{
|
||||
@@ -220,9 +220,9 @@ suite('Insights Dialog Model Tests', () => {
|
||||
['label3', 'value3']
|
||||
];
|
||||
result = insightsDialogModel.getListResources(0, 1);
|
||||
assert.equal(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.equal(isUndefinedOrNull(result[1].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.equal(result[2].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(isUndefinedOrNull(result[1].stateColor), true, 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[2].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
|
||||
label.state = [
|
||||
{
|
||||
@@ -247,8 +247,8 @@ suite('Insights Dialog Model Tests', () => {
|
||||
['label3', 'value3']
|
||||
];
|
||||
result = insightsDialogModel.getListResources(0, 1);
|
||||
assert.equal(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.equal(result[1].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.equal(result[2].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[0].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[1].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
assert.strictEqual(result[2].stateColor, 'green', 'always Condition did not return val as expected');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -70,33 +70,33 @@ suite('AsyncServerTreeDragAndDrop', () => {
|
||||
|
||||
test('create new serverTreeDragAndDrop object should create serverTreeDragAndDrop object successfully', async () => {
|
||||
|
||||
assert.equal(serverTreeDragAndDrop !== null || serverTreeDragAndDrop !== undefined, true);
|
||||
assert.strictEqual(serverTreeDragAndDrop !== null || serverTreeDragAndDrop !== undefined, true);
|
||||
});
|
||||
|
||||
test('able to get DragURI', async () => {
|
||||
let uri = serverTreeDragAndDrop.getDragURI(connectionProfile);
|
||||
assert.equal(connectionProfile.id, uri);
|
||||
assert.strictEqual(connectionProfile.id, uri);
|
||||
|
||||
let uriGroup = serverTreeDragAndDrop.getDragURI(connectionProfileGroupId);
|
||||
assert.equal(connectionProfileGroupId.id, uriGroup);
|
||||
assert.strictEqual(connectionProfileGroupId.id, uriGroup);
|
||||
|
||||
let uriUndefined = serverTreeDragAndDrop.getDragURI(undefined);
|
||||
assert.equal(null, uriUndefined);
|
||||
assert.strictEqual(null, uriUndefined);
|
||||
|
||||
});
|
||||
|
||||
test('able to get DragLabel', async () => {
|
||||
let label = serverTreeDragAndDrop.getDragLabel(connectionProfileArray);
|
||||
assert.equal(connectionProfileArray[0].serverName, label);
|
||||
assert.strictEqual(connectionProfileArray[0].serverName, label);
|
||||
|
||||
let labelGroup = serverTreeDragAndDrop.getDragLabel(connectionProfileGroupArray);
|
||||
assert.equal(connectionProfileGroupArray[0].name, labelGroup);
|
||||
assert.strictEqual(connectionProfileGroupArray[0].name, labelGroup);
|
||||
|
||||
let labelTreeNode = serverTreeDragAndDrop.getDragLabel(treeNodeArray);
|
||||
assert.equal(treeNodeArray[0].label, labelTreeNode);
|
||||
assert.strictEqual(treeNodeArray[0].label, labelTreeNode);
|
||||
|
||||
let labelUndefined = serverTreeDragAndDrop.getDragLabel(undefined);
|
||||
assert.equal('', labelUndefined);
|
||||
assert.strictEqual('', labelUndefined);
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -95,35 +95,35 @@ suite('SQL Drag And Drop Controller tests', () => {
|
||||
|
||||
test('create new serverTreeDragAndDrop object should create serverTreeDragAndDrop object successfully', async () => {
|
||||
|
||||
assert.equal(serverTreeDragAndDrop !== null || serverTreeDragAndDrop !== undefined, true);
|
||||
assert.strictEqual(serverTreeDragAndDrop !== null || serverTreeDragAndDrop !== undefined, true);
|
||||
});
|
||||
|
||||
test('able to get DragURI', async () => {
|
||||
connectionProfileArray.forEach(connectionProfile => {
|
||||
let uri = serverTreeDragAndDrop.getDragURI(testTree, connectionProfile);
|
||||
assert.equal(connectionProfile.id, uri);
|
||||
assert.strictEqual(connectionProfile.id, uri);
|
||||
});
|
||||
|
||||
let uriGroup = serverTreeDragAndDrop.getDragURI(testTree, connectionProfileGroupId);
|
||||
assert.equal(connectionProfileGroupId.id, uriGroup);
|
||||
assert.strictEqual(connectionProfileGroupId.id, uriGroup);
|
||||
|
||||
let uriUndefined = serverTreeDragAndDrop.getDragURI(testTree, null);
|
||||
assert.equal(null, uriUndefined);
|
||||
assert.strictEqual(null, uriUndefined);
|
||||
|
||||
});
|
||||
|
||||
test('able to get DragLabel', async () => {
|
||||
let label = serverTreeDragAndDrop.getDragLabel(testTree, connectionProfileArray);
|
||||
assert.equal(connectionProfileArray[0].serverName, label);
|
||||
assert.strictEqual(connectionProfileArray[0].serverName, label);
|
||||
|
||||
let labelGroup = serverTreeDragAndDrop.getDragLabel(testTree, connectionProfileGroupArray);
|
||||
assert.equal(connectionProfileGroupArray[0].name, labelGroup);
|
||||
assert.strictEqual(connectionProfileGroupArray[0].name, labelGroup);
|
||||
|
||||
let labelTreeNode = serverTreeDragAndDrop.getDragLabel(testTree, treeNodeArray);
|
||||
assert.equal(treeNodeArray[0].label, labelTreeNode);
|
||||
assert.strictEqual(treeNodeArray[0].label, labelTreeNode);
|
||||
|
||||
let labelUndefined = serverTreeDragAndDrop.getDragLabel(testTree, null);
|
||||
assert.equal('', labelUndefined);
|
||||
assert.strictEqual('', labelUndefined);
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -298,54 +298,54 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
|
||||
test('create new session should create session successfully', async () => {
|
||||
const session = await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||
assert.equal(session !== null || session !== undefined, true);
|
||||
assert.equal(session.sessionId, '1234');
|
||||
assert.strictEqual(session !== null || session !== undefined, true);
|
||||
assert.strictEqual(session.sessionId, '1234');
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
const node = objectExplorerService.getObjectExplorerNode(connection);
|
||||
assert.notEqual(node, undefined);
|
||||
assert.equal(node.session.success, true);
|
||||
assert.notStrictEqual(node, undefined);
|
||||
assert.strictEqual(node.session.success, true);
|
||||
});
|
||||
|
||||
test('create new session should raise failed event for failed session', async () => {
|
||||
const session = await objectExplorerService.createNewSession(mssqlProviderName, connectionToFail);
|
||||
assert.equal(session !== null || session !== undefined, true);
|
||||
assert.equal(session.sessionId, failedSessionId);
|
||||
assert.strictEqual(session !== null || session !== undefined, true);
|
||||
assert.strictEqual(session.sessionId, failedSessionId);
|
||||
const currentNumberOfSuccessfulSessions = numberOfSuccessfulSessions;
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerFailedSession);
|
||||
const node = objectExplorerService.getObjectExplorerNode(connection);
|
||||
assert.equal(node, undefined);
|
||||
assert.equal(currentNumberOfSuccessfulSessions, numberOfSuccessfulSessions);
|
||||
assert.strictEqual(node, undefined);
|
||||
assert.strictEqual(currentNumberOfSuccessfulSessions, numberOfSuccessfulSessions);
|
||||
});
|
||||
|
||||
test('close session should close session successfully', async () => {
|
||||
const session = await objectExplorerService.closeSession(mssqlProviderName, objectExplorerSession);
|
||||
assert.equal(session !== null || session !== undefined, true);
|
||||
assert.equal(session.success, true);
|
||||
assert.equal(session.sessionId, '1234');
|
||||
assert.strictEqual(session !== null || session !== undefined, true);
|
||||
assert.strictEqual(session.success, true);
|
||||
assert.strictEqual(session.sessionId, '1234');
|
||||
});
|
||||
|
||||
test('expand node should expand node correctly', async () => {
|
||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
const expandInfo = await objectExplorerService.expandNode(mssqlProviderName, objectExplorerSession, 'testServerName/tables');
|
||||
assert.equal(expandInfo !== null || expandInfo !== undefined, true);
|
||||
assert.equal(expandInfo.sessionId, '1234');
|
||||
assert.equal(expandInfo.nodes.length, 2);
|
||||
assert.strictEqual(expandInfo !== null || expandInfo !== undefined, true);
|
||||
assert.strictEqual(expandInfo.sessionId, '1234');
|
||||
assert.strictEqual(expandInfo.nodes.length, 2);
|
||||
const children = expandInfo.nodes;
|
||||
assert.equal(children[0].label, 'dbo.Table1');
|
||||
assert.equal(children[1].label, 'dbo.Table2');
|
||||
assert.strictEqual(children[0].label, 'dbo.Table1');
|
||||
assert.strictEqual(children[1].label, 'dbo.Table2');
|
||||
});
|
||||
|
||||
test('refresh node should refresh node correctly', async () => {
|
||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
const expandInfo = await objectExplorerService.refreshNode(mssqlProviderName, objectExplorerSession, 'testServerName/tables');
|
||||
assert.equal(expandInfo !== null || expandInfo !== undefined, true);
|
||||
assert.equal(expandInfo.sessionId, '1234');
|
||||
assert.equal(expandInfo.nodes.length, 2);
|
||||
assert.strictEqual(expandInfo !== null || expandInfo !== undefined, true);
|
||||
assert.strictEqual(expandInfo.sessionId, '1234');
|
||||
assert.strictEqual(expandInfo.nodes.length, 2);
|
||||
const children = expandInfo.nodes;
|
||||
assert.equal(children[0].label, 'dbo.Table1');
|
||||
assert.equal(children[1].label, 'dbo.Table3');
|
||||
assert.strictEqual(children[0].label, 'dbo.Table1');
|
||||
assert.strictEqual(children[1].label, 'dbo.Table3');
|
||||
});
|
||||
|
||||
test('expand tree node should get correct children', async () => {
|
||||
@@ -354,13 +354,13 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
const children = await objectExplorerService.resolveTreeNodeChildren(objectExplorerSession, tablesNode);
|
||||
assert.equal(children !== null || children !== undefined, true);
|
||||
assert.equal(children[0].label, 'dbo.Table1');
|
||||
assert.equal(children[0].parent, tablesNode);
|
||||
assert.equal(children[0].nodePath, 'testServerName/tables/dbo.Table1');
|
||||
assert.equal(children[1].label, 'dbo.Table2');
|
||||
assert.equal(children[1].parent, tablesNode);
|
||||
assert.equal(children[1].nodePath, 'testServerName/tables/dbo.Table2');
|
||||
assert.strictEqual(children !== null || children !== undefined, true);
|
||||
assert.strictEqual(children[0].label, 'dbo.Table1');
|
||||
assert.strictEqual(children[0].parent, tablesNode);
|
||||
assert.strictEqual(children[0].nodePath, 'testServerName/tables/dbo.Table1');
|
||||
assert.strictEqual(children[1].label, 'dbo.Table2');
|
||||
assert.strictEqual(children[1].parent, tablesNode);
|
||||
assert.strictEqual(children[1].nodePath, 'testServerName/tables/dbo.Table2');
|
||||
});
|
||||
|
||||
test('refresh tree node should children correctly', async () => {
|
||||
@@ -369,13 +369,13 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
const children = await objectExplorerService.refreshTreeNode(objectExplorerSession, tablesNode);
|
||||
assert.equal(children !== null || children !== undefined, true);
|
||||
assert.equal(children[0].label, 'dbo.Table1');
|
||||
assert.equal(children[0].parent, tablesNode);
|
||||
assert.equal(children[0].nodePath, 'testServerName/tables/dbo.Table1');
|
||||
assert.equal(children[1].label, 'dbo.Table3');
|
||||
assert.equal(children[1].parent, tablesNode);
|
||||
assert.equal(children[1].nodePath, 'testServerName/tables/dbo.Table3');
|
||||
assert.strictEqual(children !== null || children !== undefined, true);
|
||||
assert.strictEqual(children[0].label, 'dbo.Table1');
|
||||
assert.strictEqual(children[0].parent, tablesNode);
|
||||
assert.strictEqual(children[0].nodePath, 'testServerName/tables/dbo.Table1');
|
||||
assert.strictEqual(children[1].label, 'dbo.Table3');
|
||||
assert.strictEqual(children[1].parent, tablesNode);
|
||||
assert.strictEqual(children[1].nodePath, 'testServerName/tables/dbo.Table3');
|
||||
});
|
||||
|
||||
test('update object explorer nodes should get active connection, create session, add to the active OE nodes successfully', async () => {
|
||||
@@ -383,11 +383,11 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
await objectExplorerService.updateObjectExplorerNodes(connection);
|
||||
const treeNode = objectExplorerService.getObjectExplorerNode(connection);
|
||||
assert.equal(treeNode !== null || treeNode !== undefined, true);
|
||||
assert.equal(treeNode.getSession(), objectExplorerSession);
|
||||
assert.equal(treeNode.getConnectionProfile(), connection);
|
||||
assert.equal(treeNode.label, 'Tables');
|
||||
assert.equal(treeNode.nodePath, 'testServerName/tables');
|
||||
assert.strictEqual(treeNode !== null || treeNode !== undefined, true);
|
||||
assert.strictEqual(treeNode.getSession(), objectExplorerSession);
|
||||
assert.strictEqual(treeNode.getConnectionProfile(), connection);
|
||||
assert.strictEqual(treeNode.label, 'Tables');
|
||||
assert.strictEqual(treeNode.nodePath, 'testServerName/tables');
|
||||
});
|
||||
|
||||
test('delete object explorerNode nodes should delete session, delete the root node to the active OE node', async () => {
|
||||
@@ -395,10 +395,10 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
await objectExplorerService.updateObjectExplorerNodes(connection);
|
||||
let treeNode = objectExplorerService.getObjectExplorerNode(connection);
|
||||
assert.equal(treeNode !== null && treeNode !== undefined, true);
|
||||
assert.strictEqual(treeNode !== null && treeNode !== undefined, true);
|
||||
await objectExplorerService.deleteObjectExplorerNode(connection);
|
||||
treeNode = objectExplorerService.getObjectExplorerNode(connection);
|
||||
assert.equal(treeNode === null || treeNode === undefined, true);
|
||||
assert.strictEqual(treeNode === null || treeNode === undefined, true);
|
||||
});
|
||||
|
||||
test('children tree nodes should return correct object explorer session, connection profile and database name', () => {
|
||||
@@ -419,9 +419,9 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
const table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\\Db1\\tables\\dbo.Table1', '', '', tablesNode, undefined, undefined, undefined);
|
||||
const table2Node = new TreeNode(NodeType.Table, 'dbo.Table2', false, 'testServerName\\Db1\\tables\\dbo.Table2', '', '', tablesNode, undefined, undefined, undefined);
|
||||
tablesNode.children = [table1Node, table2Node];
|
||||
assert.equal(table1Node.getSession(), objectExplorerSession);
|
||||
assert.equal(table1Node.getConnectionProfile(), connection);
|
||||
assert.equal(table1Node.getDatabaseName(), 'Db1');
|
||||
assert.strictEqual(table1Node.getSession(), objectExplorerSession);
|
||||
assert.strictEqual(table1Node.getConnectionProfile(), connection);
|
||||
assert.strictEqual(table1Node.getDatabaseName(), 'Db1');
|
||||
});
|
||||
|
||||
test('getSelectedProfileAndDatabase returns the profile if it is selected', () => {
|
||||
@@ -430,8 +430,8 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
objectExplorerService.registerServerTreeView(serverTreeView.object);
|
||||
|
||||
const selectedProfileAndDatabase = objectExplorerService.getSelectedProfileAndDatabase();
|
||||
assert.equal(selectedProfileAndDatabase.profile, connection);
|
||||
assert.equal(selectedProfileAndDatabase.databaseName, undefined);
|
||||
assert.strictEqual(selectedProfileAndDatabase.profile, connection);
|
||||
assert.strictEqual(selectedProfileAndDatabase.databaseName, undefined);
|
||||
});
|
||||
|
||||
test('getSelectedProfileAndDatabase returns the profile but no database if children of a server are selected', () => {
|
||||
@@ -442,8 +442,8 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
objectExplorerService.registerServerTreeView(serverTreeView.object);
|
||||
|
||||
const selectedProfileAndDatabase = objectExplorerService.getSelectedProfileAndDatabase();
|
||||
assert.equal(selectedProfileAndDatabase.profile, connection);
|
||||
assert.equal(selectedProfileAndDatabase.databaseName, undefined);
|
||||
assert.strictEqual(selectedProfileAndDatabase.profile, connection);
|
||||
assert.strictEqual(selectedProfileAndDatabase.databaseName, undefined);
|
||||
});
|
||||
|
||||
test('getSelectedProfileAndDatabase returns the profile and database if children of a database node are selected', () => {
|
||||
@@ -466,8 +466,8 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
objectExplorerService.registerServerTreeView(serverTreeView.object);
|
||||
|
||||
const selectedProfileAndDatabase = objectExplorerService.getSelectedProfileAndDatabase();
|
||||
assert.equal(selectedProfileAndDatabase.profile, connection);
|
||||
assert.equal(selectedProfileAndDatabase.databaseName, databaseName);
|
||||
assert.strictEqual(selectedProfileAndDatabase.profile, connection);
|
||||
assert.strictEqual(selectedProfileAndDatabase.databaseName, databaseName);
|
||||
});
|
||||
|
||||
test('getSelectedProfileAndDatabase returns undefined when there is no selection', () => {
|
||||
@@ -476,7 +476,7 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
objectExplorerService.registerServerTreeView(serverTreeView.object);
|
||||
|
||||
const selectedProfileAndDatabase = objectExplorerService.getSelectedProfileAndDatabase();
|
||||
assert.equal(selectedProfileAndDatabase, undefined);
|
||||
assert.strictEqual(selectedProfileAndDatabase, undefined);
|
||||
});
|
||||
|
||||
test('isExpanded returns true when the node and its parents are expanded', async () => {
|
||||
@@ -501,7 +501,7 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
const tableNode = childNodes.find(node => node.nodePath === table1NodePath);
|
||||
await objectExplorerService.resolveTreeNodeChildren(objectExplorerSession, tableNode);
|
||||
const isExpanded = await tableNode.isExpanded();
|
||||
assert.equal(isExpanded, true, 'Table node was not expanded');
|
||||
assert.strictEqual(isExpanded, true, 'Table node was not expanded');
|
||||
});
|
||||
|
||||
test('isExpanded returns false when the node is not expanded', async () => {
|
||||
@@ -516,7 +516,7 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
// If I check whether the table is expanded, the answer should be no because only its parent node is expanded
|
||||
const tableNode = childNodes.find(node => node.nodePath === table1NodePath);
|
||||
const isExpanded = await tableNode.isExpanded();
|
||||
assert.equal(isExpanded, false);
|
||||
assert.strictEqual(isExpanded, false);
|
||||
});
|
||||
|
||||
test('isExpanded returns false when the parent of the requested node is not expanded', async () => {
|
||||
@@ -542,7 +542,7 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
// If I check whether the table is expanded, the answer should be yes
|
||||
const tableNode = childNodes.find(node => node.nodePath === table1NodePath);
|
||||
const isExpanded = await tableNode.isExpanded();
|
||||
assert.equal(isExpanded, false);
|
||||
assert.strictEqual(isExpanded, false);
|
||||
});
|
||||
|
||||
test('setting a node to expanded calls expand on the requested tree node', async () => {
|
||||
@@ -609,9 +609,9 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
const treeNode = await objectExplorerService.getTreeNode(connection.id, table1NodePath);
|
||||
assert.equal(treeNode.nodePath, objectExplorerExpandInfo.nodes[0].nodePath);
|
||||
assert.equal(treeNode.nodeTypeId, objectExplorerExpandInfo.nodes[0].nodeType);
|
||||
assert.equal(treeNode.label, objectExplorerExpandInfo.nodes[0].label);
|
||||
assert.strictEqual(treeNode.nodePath, objectExplorerExpandInfo.nodes[0].nodePath);
|
||||
assert.strictEqual(treeNode.nodeTypeId, objectExplorerExpandInfo.nodes[0].nodeType);
|
||||
assert.strictEqual(treeNode.label, objectExplorerExpandInfo.nodes[0].label);
|
||||
});
|
||||
|
||||
test('findTreeNode returns undefined if the requested node does not exist', async () => {
|
||||
@@ -619,7 +619,7 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||
const nodeInfo = await objectExplorerService.getTreeNode(connection.id, invalidNodePath);
|
||||
assert.equal(nodeInfo, undefined);
|
||||
assert.strictEqual(nodeInfo, undefined);
|
||||
});
|
||||
|
||||
test('refreshInView refreshes the node, expands it, and returns the refreshed node', async () => {
|
||||
@@ -636,7 +636,7 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
// Verify that it was refreshed, expanded, and the refreshed detailed were returned
|
||||
sqlOEProvider.verify(x => x.refreshNode(TypeMoq.It.is(refreshNode => refreshNode.nodePath === nodePath)), TypeMoq.Times.once());
|
||||
refreshedNode.children.forEach((childNode, index) => {
|
||||
assert.equal(childNode.nodePath, objectExplorerExpandInfoRefresh.nodes[index].nodePath);
|
||||
assert.strictEqual(childNode.nodePath, objectExplorerExpandInfoRefresh.nodes[index].nodePath);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -657,8 +657,8 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
|
||||
// Then the expand request has compconsted and the session is closed
|
||||
const expandResult = await expandPromise;
|
||||
assert.equal(expandResult.nodes.length, 0);
|
||||
assert.equal(closeSessionResult.success, true);
|
||||
assert.strictEqual(expandResult.nodes.length, 0);
|
||||
assert.strictEqual(closeSessionResult.success, true);
|
||||
});
|
||||
|
||||
test('resolveTreeNodeChildren refreshes a node if it currently has an error', async () => {
|
||||
|
||||
@@ -105,7 +105,7 @@ suite('Profiler filter data tests', () => {
|
||||
|
||||
function filterAndVerify(filter: ProfilerFilter, data: TestData[], expectedResult: TestData[], stepName: string) {
|
||||
let actualResult = FilterData(filter, data);
|
||||
assert.equal(actualResult.length, expectedResult.length, `length check for ${stepName}`);
|
||||
assert.strictEqual(actualResult.length, expectedResult.length, `length check for ${stepName}`);
|
||||
for (let i = 0; i < actualResult.length; i++) {
|
||||
let actual = actualResult[i];
|
||||
let expected = expectedResult[i];
|
||||
|
||||
@@ -36,24 +36,24 @@ suite('Query Runner', () => {
|
||||
// start batch
|
||||
const batch: BatchSummary = { id: 0, hasError: false, range: rangeSelection, resultSetSummaries: [], executionStart: '' };
|
||||
const returnBatch = await trigger(batch, arg => runner.handleBatchStart(arg), runner.onBatchStart);
|
||||
assert.deepEqual(returnBatch, batch);
|
||||
assert.deepStrictEqual(returnBatch, batch);
|
||||
// we expect the query runner to create a message sense we sent a selection
|
||||
assert(runner.messages.length === 1);
|
||||
// start result set
|
||||
const result1: ResultSetSummary = { batchId: 0, id: 0, complete: false, rowCount: 0, columnInfo: [{ columnName: 'column' }] };
|
||||
const returnResult = await trigger(result1, arg => runner.handleResultSetAvailable(arg), runner.onResultSet);
|
||||
assert.deepEqual(returnResult, result1);
|
||||
assert.deepEqual(runner.batchSets[0].resultSetSummaries[0], result1);
|
||||
assert.deepStrictEqual(returnResult, result1);
|
||||
assert.deepStrictEqual(runner.batchSets[0].resultSetSummaries[0], result1);
|
||||
// update result set
|
||||
const result1Update: ResultSetSummary = { batchId: 0, id: 0, complete: true, rowCount: 100, columnInfo: [{ columnName: 'column' }] };
|
||||
const returnResultUpdate = await trigger(result1Update, arg => runner.handleResultSetUpdated(arg), runner.onResultSetUpdate);
|
||||
assert.deepEqual(returnResultUpdate, result1Update);
|
||||
assert.deepEqual(runner.batchSets[0].resultSetSummaries[0], result1Update);
|
||||
assert.deepStrictEqual(returnResultUpdate, result1Update);
|
||||
assert.deepStrictEqual(runner.batchSets[0].resultSetSummaries[0], result1Update);
|
||||
// post message
|
||||
const message: IResultMessage = { message: 'some message', isError: false, batchId: 0 };
|
||||
const messageReturn = await trigger([message], arg => runner.handleMessage(arg), runner.onMessage);
|
||||
assert.deepEqual(messageReturn[0], message);
|
||||
assert.deepEqual(runner.messages[1], message);
|
||||
assert.deepStrictEqual(messageReturn[0], message);
|
||||
assert.deepStrictEqual(runner.messages[1], message);
|
||||
// get query rows
|
||||
const rowResults: ResultSetSubset = { rowCount: 100, rows: range(100).map(r => range(1).map(c => ({ displayValue: `${r}${c}` }))) };
|
||||
const getRowStub = sinon.stub().returns(Promise.resolve(rowResults));
|
||||
@@ -126,7 +126,7 @@ suite('Query Runner', () => {
|
||||
runner.handleResultSetAvailable({ id: 0, batchId: 0, complete: true, rowCount: 1, columnInfo: [{ columnName: 'Microsoft SQL Server 2005 XML Showplan' }] });
|
||||
const plan = await runner.planXml;
|
||||
assert(getRowsStub.calledOnce);
|
||||
assert.equal(plan, xmlPlan);
|
||||
assert.strictEqual(plan, xmlPlan);
|
||||
assert(runner.isQueryPlan);
|
||||
});
|
||||
|
||||
@@ -147,7 +147,7 @@ suite('Query Runner', () => {
|
||||
runner.handleResultSetUpdated({ id: 0, batchId: 0, complete: true, rowCount: 1, columnInfo: [{ columnName: 'Microsoft SQL Server 2005 XML Showplan' }] });
|
||||
const plan = await runner.planXml;
|
||||
assert(getRowsStub.calledOnce);
|
||||
assert.equal(plan, xmlPlan);
|
||||
assert.strictEqual(plan, xmlPlan);
|
||||
assert(runner.isQueryPlan);
|
||||
});
|
||||
|
||||
|
||||
@@ -120,39 +120,39 @@ suite('Restore Dialog view model tests', () => {
|
||||
|
||||
test('get boolean option type should return correct display value', () => {
|
||||
let falseStringOptionValue = 'False';
|
||||
assert.equal(false, viewModel.getDisplayValue(booleanServiceOption, falseStringOptionValue));
|
||||
assert.strictEqual(false, viewModel.getDisplayValue(booleanServiceOption, falseStringOptionValue));
|
||||
|
||||
let falseBooleanOptionValue = false;
|
||||
assert.equal(false, viewModel.getDisplayValue(booleanServiceOption, falseBooleanOptionValue));
|
||||
assert.strictEqual(false, viewModel.getDisplayValue(booleanServiceOption, falseBooleanOptionValue));
|
||||
|
||||
let trueStringOptionValue = 'true';
|
||||
assert.equal(true, viewModel.getDisplayValue(booleanServiceOption, trueStringOptionValue));
|
||||
assert.strictEqual(true, viewModel.getDisplayValue(booleanServiceOption, trueStringOptionValue));
|
||||
|
||||
let undefinedOptionValue = undefined;
|
||||
assert.equal(false, viewModel.getDisplayValue(booleanServiceOption, undefinedOptionValue));
|
||||
assert.strictEqual(false, viewModel.getDisplayValue(booleanServiceOption, undefinedOptionValue));
|
||||
});
|
||||
|
||||
test('get category option type should return correct display value', () => {
|
||||
let categoryOptionValue = 'catagory2';
|
||||
assert.equal('Catagory 2', viewModel.getDisplayValue(categoryServiceOption, categoryOptionValue));
|
||||
assert.strictEqual('Catagory 2', viewModel.getDisplayValue(categoryServiceOption, categoryOptionValue));
|
||||
|
||||
let undefinedOptionValue = undefined;
|
||||
assert.equal('Catagory 1', viewModel.getDisplayValue(categoryServiceOption, undefinedOptionValue));
|
||||
assert.strictEqual('Catagory 1', viewModel.getDisplayValue(categoryServiceOption, undefinedOptionValue));
|
||||
});
|
||||
|
||||
test('get string option type should return correct display value', () => {
|
||||
let stringOptionValue = 'string1';
|
||||
assert.equal(stringOptionValue, viewModel.getDisplayValue(stringServiceOption, stringOptionValue));
|
||||
assert.strictEqual(stringOptionValue, viewModel.getDisplayValue(stringServiceOption, stringOptionValue));
|
||||
|
||||
let undefinedOptionValue = undefined;
|
||||
assert.equal('', viewModel.getDisplayValue(stringServiceOption, undefinedOptionValue));
|
||||
assert.strictEqual('', viewModel.getDisplayValue(stringServiceOption, undefinedOptionValue));
|
||||
});
|
||||
|
||||
test('get option meta data should return the correct one', () => {
|
||||
assert.equal(stringServiceOption, viewModel.getOptionMetadata(option1String));
|
||||
assert.equal(categoryServiceOption, viewModel.getOptionMetadata(option2Category));
|
||||
assert.equal(booleanServiceOption, viewModel.getOptionMetadata(option3Boolean));
|
||||
assert.equal(undefined, viewModel.getOptionMetadata('option4'));
|
||||
assert.strictEqual(stringServiceOption, viewModel.getOptionMetadata(option1String));
|
||||
assert.strictEqual(categoryServiceOption, viewModel.getOptionMetadata(option2Category));
|
||||
assert.strictEqual(booleanServiceOption, viewModel.getOptionMetadata(option3Boolean));
|
||||
assert.strictEqual(undefined, viewModel.getOptionMetadata('option4'));
|
||||
});
|
||||
|
||||
test('get restore advanced option should return the only the options that have been changed and are different from the default value', () => {
|
||||
@@ -161,9 +161,9 @@ suite('Restore Dialog view model tests', () => {
|
||||
viewModel.setOptionValue(option3Boolean, false);
|
||||
options = {};
|
||||
viewModel.getRestoreAdvancedOptions(options);
|
||||
assert.equal(undefined, options[option1String]);
|
||||
assert.equal('catagory2', options[option2Category]);
|
||||
assert.equal(false, options[option3Boolean]);
|
||||
assert.strictEqual(undefined, options[option1String]);
|
||||
assert.strictEqual('catagory2', options[option2Category]);
|
||||
assert.strictEqual(false, options[option3Boolean]);
|
||||
});
|
||||
|
||||
test('on restore plan response should update all options from restore plan response correctly', () => {
|
||||
@@ -179,19 +179,19 @@ suite('Restore Dialog view model tests', () => {
|
||||
viewModel.onRestorePlanResponse(restorePlanResponse);
|
||||
|
||||
// verify that source database, target databasem and last backup get set correctly
|
||||
assert.equal('dbSource', viewModel.sourceDatabaseName);
|
||||
assert.equal('db1', viewModel.targetDatabaseName);
|
||||
assert.equal('8/16/2017', viewModel.lastBackupTaken);
|
||||
assert.strictEqual('dbSource', viewModel.sourceDatabaseName);
|
||||
assert.strictEqual('db1', viewModel.targetDatabaseName);
|
||||
assert.strictEqual('8/16/2017', viewModel.lastBackupTaken);
|
||||
|
||||
// verify that advanced options get set correctly
|
||||
options = {};
|
||||
viewModel.getRestoreAdvancedOptions(options);
|
||||
assert.equal('newOptionValue', options[option1String]);
|
||||
assert.strictEqual('newOptionValue', options[option1String]);
|
||||
|
||||
// verify that selected backup sets get set correctly
|
||||
let selectedBackupSets = viewModel.selectedBackupSets;
|
||||
assert.equal(1, selectedBackupSets!.length);
|
||||
assert.equal('file2', selectedBackupSets![0]);
|
||||
assert.strictEqual(1, selectedBackupSets!.length);
|
||||
assert.strictEqual('file2', selectedBackupSets![0]);
|
||||
});
|
||||
|
||||
|
||||
@@ -211,20 +211,20 @@ suite('Restore Dialog view model tests', () => {
|
||||
viewModel.resetRestoreOptions('db2');
|
||||
|
||||
// verify that file path, source database, target databasem and last backup get set correctly
|
||||
assert.equal('', viewModel.lastBackupTaken);
|
||||
assert.equal('db2', viewModel.sourceDatabaseName);
|
||||
assert.equal('db2', viewModel.targetDatabaseName);
|
||||
assert.equal('', viewModel.lastBackupTaken);
|
||||
assert.equal(0, viewModel.databaseList!.length);
|
||||
assert.strictEqual('', viewModel.lastBackupTaken);
|
||||
assert.strictEqual('db2', viewModel.sourceDatabaseName);
|
||||
assert.strictEqual('db2', viewModel.targetDatabaseName);
|
||||
assert.strictEqual('', viewModel.lastBackupTaken);
|
||||
assert.strictEqual(0, viewModel.databaseList!.length);
|
||||
|
||||
// verify that advanced options get set correctly
|
||||
options = {};
|
||||
viewModel.getRestoreAdvancedOptions(options);
|
||||
assert.equal(undefined, options[option1String]);
|
||||
assert.strictEqual(undefined, options[option1String]);
|
||||
|
||||
// verify that selected backup sets get set correctly
|
||||
let selectedBackupSets = viewModel.selectedBackupSets;
|
||||
assert.equal(undefined, selectedBackupSets);
|
||||
assert.strictEqual(undefined, selectedBackupSets);
|
||||
});
|
||||
|
||||
test('update options with config info should update option correctly', () => {
|
||||
@@ -234,16 +234,16 @@ suite('Restore Dialog view model tests', () => {
|
||||
configInfo[option1String] = 'option1 from config info';
|
||||
viewModel.updateOptionWithConfigInfo(configInfo);
|
||||
assert.ok(viewModel.databaseList);
|
||||
assert.equal(3, viewModel.databaseList!.length);
|
||||
assert.equal('', viewModel.databaseList![0]);
|
||||
assert.equal(databaseList[1], viewModel.databaseList![1]);
|
||||
assert.equal(databaseList[2], viewModel.databaseList![2]);
|
||||
assert.equal('option1 from config info', viewModel.getOptionValue(option1String));
|
||||
assert.strictEqual(3, viewModel.databaseList!.length);
|
||||
assert.strictEqual('', viewModel.databaseList![0]);
|
||||
assert.strictEqual(databaseList[1], viewModel.databaseList![1]);
|
||||
assert.strictEqual(databaseList[2], viewModel.databaseList![2]);
|
||||
assert.strictEqual('option1 from config info', viewModel.getOptionValue(option1String));
|
||||
|
||||
// verify that the options from get restore advanced options doesn't contain option1String
|
||||
options = {};
|
||||
viewModel.getRestoreAdvancedOptions(options);
|
||||
assert.equal(undefined, options[option1String]);
|
||||
assert.strictEqual(undefined, options[option1String]);
|
||||
});
|
||||
|
||||
test('on restore from changed should set readHeaderFromMedia and reset the source database names and selected database name correctly', () => {
|
||||
@@ -252,13 +252,13 @@ suite('Restore Dialog view model tests', () => {
|
||||
viewModel.filePath = 'filepath';
|
||||
viewModel.readHeaderFromMedia = false;
|
||||
viewModel.onRestoreFromChanged(true);
|
||||
assert.equal(true, viewModel.readHeaderFromMedia);
|
||||
assert.equal(undefined, viewModel.sourceDatabaseName);
|
||||
assert.equal('', viewModel.filePath);
|
||||
assert.strictEqual(true, viewModel.readHeaderFromMedia);
|
||||
assert.strictEqual(undefined, viewModel.sourceDatabaseName);
|
||||
assert.strictEqual('', viewModel.filePath);
|
||||
|
||||
viewModel.sourceDatabaseName = 'sourceDatabase2';
|
||||
viewModel.onRestoreFromChanged(false);
|
||||
assert.equal(false, viewModel.readHeaderFromMedia);
|
||||
assert.equal('', viewModel.sourceDatabaseName);
|
||||
assert.strictEqual(false, viewModel.readHeaderFromMedia);
|
||||
assert.strictEqual('', viewModel.sourceDatabaseName);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user