From c032bfea8d383da3a34232ed868891224b88bc88 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 30 Nov 2021 14:39:45 -0600 Subject: [PATCH 1/2] fix: registry validation prevents ignoring non-supported types --- src/registry/nonSupportedTypes.ts | 2 -- test/registry/registryValidation.test.ts | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/registry/nonSupportedTypes.ts b/src/registry/nonSupportedTypes.ts index 12f931a8e9..20f2d97aeb 100644 --- a/src/registry/nonSupportedTypes.ts +++ b/src/registry/nonSupportedTypes.ts @@ -26,8 +26,6 @@ export const metadataTypes = [ // things that don't show up in describe so far 'PicklistValue', // only existed in v37, so it's hard to describe! - 'FieldRestrictionRule', // not in describe for devorg. ScratchDef might need feature 'EMPLOYEEEXPERIENCE' but it doesn't say that - 'AppointmentSchedulingPolicy', // not in describe? 'AppointmentAssignmentPolicy', // not in describe? 'WorkflowFlowAction', // not in describe 'AdvAcctForecastDimSource', // not in describe diff --git a/test/registry/registryValidation.test.ts b/test/registry/registryValidation.test.ts index f85f2776ab..7ecd056520 100644 --- a/test/registry/registryValidation.test.ts +++ b/test/registry/registryValidation.test.ts @@ -8,11 +8,27 @@ import { expect } from 'chai'; import { MetadataRegistry } from '../../src'; import { registry as defaultRegistry } from '../../src/registry/registry'; import { MetadataType } from '../../src/registry/types'; +import { metadataTypes as UnsupportedTypes } from '../../src/registry/nonSupportedTypes'; describe('Registry Validation', () => { const registry = defaultRegistry as MetadataRegistry; const typesWithChildren = Object.values(registry.types).filter((type) => type.children); + describe('non-supported types', () => { + Object.values(registry.types).forEach((type) => { + it(`${type.name} should not be in UnsupportedTypes`, () => { + expect(UnsupportedTypes).to.not.include(type.name); + }); + }); + typesWithChildren.forEach((type) => { + Object.values(type.children.types).forEach((child) => { + it(`${child.name} should not be in UnsupportedTypes`, () => { + expect(UnsupportedTypes).to.not.include(child.name); + }); + }); + }); + }); + describe('child types', () => { describe('child types are configured properly', () => { typesWithChildren.forEach((type) => { From a5f3962f562bc39c50eb283138644532624aa97b Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 30 Nov 2021 14:45:03 -0600 Subject: [PATCH 2/2] test: remove spec so test:registry runs only one test --- .mocharc.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.mocharc.json b/.mocharc.json index 704992edb6..714e3cc6f5 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -2,7 +2,6 @@ "require": "ts-node/register,source-map-support/register", "watch-extensions": "ts", "extensions": [".ts", ".js", ".json"], - "spec": ["./test/**/*.test.ts"], "watch-files": ["src", "test"], "recursive": true, "reporter": "spec",