mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421 (#7404)
* Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421 * readd svgs
This commit is contained in:
@@ -81,4 +81,52 @@ suite('Telemetry - common properties', function () {
|
||||
value2 = props['common.timesincesessionstart'];
|
||||
assert.ok(value1 !== value2, 'timesincesessionstart');
|
||||
});
|
||||
|
||||
test('mixes in additional properties', async function () {
|
||||
const resolveCommonTelemetryProperties = () => {
|
||||
return {
|
||||
'userId': '1'
|
||||
};
|
||||
};
|
||||
|
||||
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource, undefined, resolveCommonTelemetryProperties);
|
||||
|
||||
assert.ok('commitHash' in props);
|
||||
assert.ok('sessionID' in props);
|
||||
assert.ok('timestamp' in props);
|
||||
assert.ok('common.platform' in props);
|
||||
assert.ok('common.nodePlatform' in props);
|
||||
assert.ok('common.nodeArch' in props);
|
||||
assert.ok('common.timesincesessionstart' in props);
|
||||
assert.ok('common.sequence' in props);
|
||||
assert.ok('common.platformVersion' in props, 'platformVersion');
|
||||
assert.ok('version' in props);
|
||||
assert.ok('common.firstSessionDate' in props, 'firstSessionDate');
|
||||
assert.ok('common.lastSessionDate' in props, 'lastSessionDate');
|
||||
assert.ok('common.isNewSession' in props, 'isNewSession');
|
||||
assert.ok('common.instanceId' in props, 'instanceId');
|
||||
assert.ok('common.machineId' in props, 'machineId');
|
||||
|
||||
assert.equal(props['userId'], '1');
|
||||
});
|
||||
|
||||
test('mixes in additional dyanmic properties', async function () {
|
||||
let i = 1;
|
||||
const resolveCommonTelemetryProperties = () => {
|
||||
return Object.defineProperties({}, {
|
||||
'userId': {
|
||||
get: () => {
|
||||
return i++;
|
||||
},
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource, undefined, resolveCommonTelemetryProperties);
|
||||
assert.equal(props['userId'], '1');
|
||||
|
||||
const props2 = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource, undefined, resolveCommonTelemetryProperties);
|
||||
assert.equal(props2['userId'], '2');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user