Skip to content

Commit

Permalink
feat: add restriction rules metadata (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon authored Jun 12, 2022
1 parent f2ae7d2 commit 24a818d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
18 changes: 14 additions & 4 deletions __tests__/unit/lib/service/standardHandler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ const testContext = {
'force-app/main/default/classes/controllers/Controller.cls-meta.xml',
new Set(['Controller']),
],
[
'restrictionRules',
'force-app/main/default/restrictionRules/Account.rule-meta.xml',
new Set(['Account']),
],
[
'objects',
'force-app/main/default/objects/Test/Account/Account.object-meta.xml',
Expand Down Expand Up @@ -71,6 +76,11 @@ const testContext = {
'force-app/main/default/classes/Test/Controller.cls-meta.xml',
new Set(['Controller']),
],
[
'restrictionRules',
'force-app/main/default/restrictionRules/Test/Account.rule-meta.xml',
new Set(['Account']),
],
],
work: {
config: { output: '', repo: '', generateDelta: true },
Expand All @@ -81,7 +91,7 @@ const testContext = {
describe(`standardHandler`, () => {
let globalMetadata
beforeAll(async () => {
globalMetadata = await metadataManager.getDefinition('directoryName', 50)
globalMetadata = await metadataManager.getDefinition('directoryName', 54)
})

beforeEach(() => {
Expand All @@ -100,9 +110,9 @@ describe(`standardHandler`, () => {
globalMetadata
)
await handler.handle()
expect(testContext.work.diffs.package.get('classes')).toEqual(
testContext.testData[5][2]
)
expect(
testContext.work.diffs.package.get(testContext.testData[0][0])
).toEqual(testContext.testData[0][2])
})

test('do not handle not ADM line', async () => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"test:coverage": "jest --coverage --runInBand",
"test:debug": "node --inspect node_modules/.bin/jest",
"test:debug:break": "node --inspect-brk node_modules/.bin/jest",
"test:watch": "jest --watch",
"postpack": "rm -f oclif.manifest.json && prettier --write README.md",
"postrelease": "yarn release:tags && yarn release:github",
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
Expand Down
7 changes: 7 additions & 0 deletions src/metadata/v52.json
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,13 @@
"suffix": "deployment",
"xmlName": "RecordActionDeployment"
},
{
"directoryName": "restrictionRules",
"inFolder": false,
"metaFile": false,
"suffix": "rule",
"xmlName": "RestrictionRule"
},
{
"directoryName": "EmbeddedServiceConfig",
"inFolder": false,
Expand Down
7 changes: 7 additions & 0 deletions src/metadata/v53.json
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,13 @@
"suffix": "deployment",
"xmlName": "RecordActionDeployment"
},
{
"directoryName": "restrictionRules",
"inFolder": false,
"metaFile": false,
"suffix": "rule",
"xmlName": "RestrictionRule"
},
{
"directoryName": "EmbeddedServiceConfig",
"inFolder": false,
Expand Down
7 changes: 7 additions & 0 deletions src/metadata/v54.json
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,13 @@
"suffix": "deployment",
"xmlName": "RecordActionDeployment"
},
{
"directoryName": "restrictionRules",
"inFolder": false,
"metaFile": false,
"suffix": "rule",
"xmlName": "RestrictionRule"
},
{
"directoryName": "EmbeddedServiceConfig",
"inFolder": false,
Expand Down

0 comments on commit 24a818d

Please sign in to comment.