fixes issue with getcompliancesteps for schemaless datasets versus datasets with a schema

This commit is contained in:
Seyi Adebajo 2017-12-14 08:35:55 -08:00
parent 3e03c342e8
commit fcc1c5544b
2 changed files with 4 additions and 6 deletions

View File

@ -93,12 +93,10 @@ const complianceSteps = {
/**
* Takes a map of dataset options and constructs the relevant compliance edit wizard steps to build the wizard flow
* @param {{ hasSchema: boolean }} [{ hasSchema }={ hasSchema: true }] flag indicating if the dataset is schema-less
* @returns {([x: number]: {name: string})}
* @param {boolean} [hasSchema=true] flag indicating if the dataset has a schema or otherwise
* @returns {({ [x: number]: { name: string } })}
*/
const getComplianceSteps = (
{ hasSchema }: { hasSchema: boolean } = { hasSchema: true }
): { [x: number]: { name: string } } => {
const getComplianceSteps = (hasSchema: boolean = true): { [x: number]: { name: string } } => {
// Step to tag dataset with PII data, this is at the dataset level for schema-less datasets
const piiTaggingStep = { 0: { name: 'editDatasetLevelCompliancePolicy' } };

View File

@ -19,7 +19,7 @@ test('getComplianceSteps function should behave as expected', function(assert) {
assert.deepEqual(result, complianceSteps, 'getComplianceSteps result is expected shape when no args are passed');
result = getComplianceSteps({ hasSchema: false });
result = getComplianceSteps(false);
assert.deepEqual(
result,
{ ...complianceSteps, ...piiTaggingStep },