mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 17:22:20 -05:00
Exclude Object Types Coming from DacFx and tests all working as expected (#20015)
* Include Objects Coming from DacFx and tests all working as expected * Exclude Object types functionality is working as expected and Unit tests * more refactor updates * Updated comments and prop name * Addressing the coments and code updates accordingly * Updating according to the comments * STS vbump * These changes should be deleted with SC changes, not here * format fixed
This commit is contained in:
committed by
GitHub
parent
66115d8f80
commit
2b5d2f0a0b
@@ -19,7 +19,7 @@ describe('Publish Dialog Deploy Options Model', () => {
|
||||
const model = new DeployOptionsModel(testUtils.getDeploymentOptions());
|
||||
Object.entries(model.deploymentOptions.booleanOptionsDictionary).forEach(option => {
|
||||
// option[1] contains the value, description and displayName
|
||||
should(model.getOptionDescription(option[1].displayName)).not.equal(undefined);
|
||||
should(model.getOptionDescription(option[1].displayName)).not.equal(undefined, 'publish option description should not be undefined');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,4 +27,31 @@ describe('Publish Dialog Deploy Options Model', () => {
|
||||
const model = new DeployOptionsModel(testUtils.getDeploymentOptions());
|
||||
should(model.getOptionDescription('')).equal('');
|
||||
});
|
||||
|
||||
|
||||
it('Should have no default exclude object types', function (): void {
|
||||
const model = new DeployOptionsModel(testUtils.getDeploymentOptions());
|
||||
should(model.deploymentOptions.excludeObjectTypes.value.length).be.equal(0, 'There should be no object types excluded from excludeObjectTypes');
|
||||
|
||||
// should return true for all object type options as there are no default excludeObjectTypes in the deployment options
|
||||
Object.keys(model.deploymentOptions.objectTypesDictionary).forEach(option => {
|
||||
should(model.getExcludeObjectTypeOptionCheckStatus(option)).equal(false, 'excludeObjectTypes property should be empty by default and return false');
|
||||
});
|
||||
});
|
||||
|
||||
it('Should have atleast one default exclude object types', function (): void {
|
||||
const model = new DeployOptionsModel(testUtils.getDeploymentOptions());
|
||||
model.deploymentOptions.excludeObjectTypes.value = ['SampleProperty1'];
|
||||
|
||||
should(model.deploymentOptions.excludeObjectTypes.value.length).be.equal(1, 'There should be one excluded object');
|
||||
|
||||
// should return true for all exclude object types options and false for the exising defauit option
|
||||
Object.keys(model.deploymentOptions.objectTypesDictionary).forEach(option => {
|
||||
if (option === 'SampleProperty1') {
|
||||
should(model.getExcludeObjectTypeOptionCheckStatus(option)).equal(true, 'should return true for the excludeObjectTypes SampleProperty1 ');
|
||||
} else {
|
||||
should(model.getExcludeObjectTypeOptionCheckStatus(option)).equal(false, 'should return false for all excludeObjectTypes property as it is empty');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -31,6 +31,10 @@ export function getDeploymentOptions(): mssql.DeploymentOptions {
|
||||
booleanOptionsDictionary: {
|
||||
'SampleProperty1': { value: false, description: sampleDesc, displayName: sampleName },
|
||||
'SampleProperty2': { value: false, description: sampleDesc, displayName: sampleName }
|
||||
},
|
||||
objectTypesDictionary: {
|
||||
'SampleProperty1': sampleName,
|
||||
'SampleProperty2': sampleName
|
||||
}
|
||||
};
|
||||
return defaultOptions;
|
||||
|
||||
Reference in New Issue
Block a user