Skip to content

Commit

Permalink
Revert "feat: handle decomposed type (scolladon#825)"
Browse files Browse the repository at this point in the history
This reverts commit ec9ea59.
  • Loading branch information
a-ursu committed May 24, 2024
1 parent d2a82f3 commit a16c498
Show file tree
Hide file tree
Showing 62 changed files with 1,641 additions and 1,649 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.next
output
reports
.github
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {
'output',
'reports',
'e2e',
'.github',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/on-merged-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:

- uses: jwalton/gh-find-current-pr@master
id: pr-number
with:
state: closed

- name: Set dev channel value
run: |
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ This repository provide [.prettierignore](.prettierignore) and [.prettierrc](.pr

### Code linting

[ESLint](https://eslint.org/) is a popular JavaScript linting tool used to identify stylistic errors and erroneous constructs.
[ESLint](https://eslint.org/) is a popular JavaScript linting tool used to identify stylistic errors and erroneous constructs. This repository provide [.eslintignore](.eslintignore) file to exclude specific files from the linting process.

### Commit linting

Expand Down
4 changes: 2 additions & 2 deletions __tests__/functional/delta.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ describe('sgd:source:delta NUTS', () => {
const destructiveChangesLineCount = await getFileLineNumber(
'e2e/expected/destructiveChanges/destructiveChanges.xml'
)
expect(packageLineCount).to.equal(232)
expect(destructiveChangesLineCount).to.equal(137)
expect(packageLineCount).to.equal(221)
expect(destructiveChangesLineCount).to.equal(130)
expect(result).to.include('"error": null')
expect(result).to.include('"success": true')
})
Expand Down
16 changes: 1 addition & 15 deletions __tests__/integration/services.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,6 @@ jest.mock('../../src/utils/fsHelper')

const mockedReadPathFromGit = jest.mocked(readPathFromGit)
const testContext = [
[
'force-app/main/default/permissionsets/Admin/permissionSetFieldPermissions/Account.Test__c.permissionSetFieldPermission-meta.xml',
new Set(['Admin']),
'PermissionSet',
],
[
'force-app/main/default/sharingRules/Account/sharingCriteriaRules/TestSharingCriteria.sharingCriteriaRule-meta.xml',
new Set(['Account.TestSharingCriteria']),
'SharingCriteriaRule',
],
[
'force-app/main/default/workflows/Account/alerts/TestWFAlert.alert-meta.xml',
new Set(['Account.TestWFAlert']),
'WorkflowAlert',
],
[
'force-app/main/default/bots/TestBot/TestBot.bot-meta.xml',
new Set(['TestBot']),
Expand Down Expand Up @@ -441,6 +426,7 @@ const testContext = [

let globalMetadata: MetadataRepository
beforeAll(async () => {
// eslint-disable-next-line no-undef
globalMetadata = await getGlobalMetadata()
})
let work: Work
Expand Down
14 changes: 7 additions & 7 deletions __tests__/unit/lib/metadata/MetadataRepositoryImpl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ describe('MetadataRepositoryImpl', () => {
suffix: 'document',
xmlName: 'Document',
},
{
directoryName: 'restrictionRules',
inFolder: false,
metaFile: false,
suffix: 'rule',
xmlName: 'RestrictionRule',
},
{
directoryName: 'moderation',
inFolder: false,
Expand Down Expand Up @@ -77,6 +70,13 @@ describe('MetadataRepositoryImpl', () => {
suffix: 'object',
xmlName: 'CustomObject',
},
{
directoryName: 'restrictionRules',
inFolder: false,
metaFile: false,
suffix: 'rule',
xmlName: 'RestrictionRule',
},
{
directoryName: 'classes',
inFolder: false,
Expand Down
1 change: 1 addition & 0 deletions __tests__/unit/lib/post-processor/includeProcessor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('IncludeProcessor', () => {
let metadata: MetadataRepository

beforeAll(async () => {
// eslint-disable-next-line no-undef
metadata = await getGlobalMetadata()
})

Expand Down
18 changes: 2 additions & 16 deletions __tests__/unit/lib/service/botHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,13 @@ import { expect, jest, describe, it } from '@jest/globals'

import { MetadataRepository } from '../../../../src/metadata/MetadataRepository'
import BotHandler from '../../../../src/service/botHandler'
import { Metadata } from '../../../../src/types/metadata'
import type { Work } from '../../../../src/types/work'
import { copyFiles } from '../../../../src/utils/fsHelper'
import { getGlobalMetadata, getWork } from '../../../__utils__/globalTestHelper'

jest.mock('../../../../src/utils/fsHelper')

const objectType: Metadata = {
directoryName: 'bots',
inFolder: false,
metaFile: true,
content: [
{
suffix: 'bot',
xmlName: 'Bot',
},
{
suffix: 'botVersion',
xmlName: 'BotVersion',
},
],
}
const objectType = 'bots'
const line =
'A force-app/main/default/bots/TestBot/v1.botVersion-meta.xml'

Expand All @@ -37,6 +22,7 @@ beforeEach(() => {
describe('BotHandler', () => {
let globalMetadata: MetadataRepository
beforeAll(async () => {
// eslint-disable-next-line no-undef
globalMetadata = await getGlobalMetadata()
})

Expand Down
88 changes: 0 additions & 88 deletions __tests__/unit/lib/service/customLabelHandler.test.ts

This file was deleted.

32 changes: 3 additions & 29 deletions __tests__/unit/lib/service/customObjectHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,7 @@ const mockedReadPathFromGit = jest.mocked(readPathFromGit)

mockedPathExist.mockResolvedValue(true)

const territoryModelType = {
childXmlNames: ['Territory2Rule', 'Territory2'],
directoryName: 'territory2Models',
inFolder: false,
metaFile: false,
suffix: 'territory2Model',
xmlName: 'Territory2Model',
}
const objectType = {
childXmlNames: [
'CustomField',
'Index',
'BusinessProcess',
'RecordType',
'CompactLayout',
'WebLink',
'ValidationRule',
'SharingReason',
'ListView',
'FieldSet',
],
directoryName: 'objects',
inFolder: false,
metaFile: false,
suffix: 'object',
xmlName: 'CustomObject',
}

const objectType = 'objects'
const line =
'A force-app/main/default/objects/Account/Account.object-meta.xml'

Expand All @@ -61,6 +34,7 @@ beforeEach(() => {
describe('CustomObjectHandler', () => {
let globalMetadata: MetadataRepository
beforeAll(async () => {
// eslint-disable-next-line no-undef
globalMetadata = await getGlobalMetadata()
})

Expand Down Expand Up @@ -89,7 +63,7 @@ describe('CustomObjectHandler', () => {
// Arrange
const sut = new CustomObjectHandler(
'A force-app/main/default/territory2Models/EU/EU.territory2Model-meta.xml',
territoryModelType,
'territory2Models',
work,
globalMetadata
)
Expand Down
58 changes: 0 additions & 58 deletions __tests__/unit/lib/service/decomposedHandler.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('DiffLineInterpreter', () => {
let sut: DiffLineInterpreter
let globalMetadata: MetadataRepository
beforeAll(async () => {
// eslint-disable-next-line no-undef
globalMetadata = await getGlobalMetadata()
})

Expand Down
1 change: 1 addition & 0 deletions __tests__/unit/lib/service/diffLineInterpreter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('DiffLineInterpreter', () => {
let sut: DiffLineInterpreter
let globalMetadata: MetadataRepository
beforeAll(async () => {
// eslint-disable-next-line no-undef
globalMetadata = await getGlobalMetadata()
})

Expand Down
9 changes: 2 additions & 7 deletions __tests__/unit/lib/service/inBundleHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ import InBundleHandler from '../../../../src/service/inBundleHandler'
import type { Work } from '../../../../src/types/work'
import { getGlobalMetadata, getWork } from '../../../__utils__/globalTestHelper'

const objectType = {
directoryName: 'digitalExperiences',
inFolder: false,
metaFile: true,
suffix: 'digitalExperience',
xmlName: 'DigitalExperienceBundle',
}
const objectType = 'digitalExperiences'
const entityPath =
'force-app/main/default/digitalExperiences/site/component.digitalExperience-meta.xml'
const line = `A ${entityPath}`
Expand All @@ -26,6 +20,7 @@ beforeEach(() => {
describe('InBundleHandler', () => {
let globalMetadata: MetadataRepository
beforeAll(async () => {
// eslint-disable-next-line no-undef
globalMetadata = await getGlobalMetadata()
})

Expand Down
Loading

0 comments on commit a16c498

Please sign in to comment.