Skip to content

Commit 57bc064

Browse files
committed
chore: wip
1 parent fc61ee0 commit 57bc064

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

src/convert/transformers/decomposeExternalServiceRegistrationTransformer.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ export class DecomposeExternalServiceRegistrationTransformer extends BaseMetadat
2626
component: SourceComponent;
2727
mergeWith?: SourceComponent | undefined;
2828
}): Promise<WriteInfo[]> {
29-
this.context.decomposedExternalServiceRegistration.externalServiceRegistration ??=
30-
this.registry.getTypeByName('ExternalServiceRegistration');
3129
const writeInfos: WriteInfo[] = [];
3230
const { component } = input;
3331
const xmlContent = await component.parseXml<ESR>();
@@ -38,13 +36,7 @@ export class DecomposeExternalServiceRegistrationTransformer extends BaseMetadat
3836
const schemaContent: string = esrContent.schema ?? '';
3937
const schemaExtension = this.getSchemaExtension(schemaContent);
4038
const schemaFileName = `${component.fullName}.${schemaExtension}`;
41-
const schemaFilePath = path.join(
42-
this.defaultDirectory ?? '',
43-
'main',
44-
'default',
45-
component.type.directoryName,
46-
schemaFileName
47-
);
39+
const schemaFilePath = path.join(this.defaultDirectory ?? '', component.type.directoryName, schemaFileName);
4840

4941
// Write schema content to file
5042
writeInfos.push({
@@ -57,13 +49,7 @@ export class DecomposeExternalServiceRegistrationTransformer extends BaseMetadat
5749

5850
// Write remaining ESR content to file
5951
const esrFileName = `${component.fullName}.externalServiceRegistration`;
60-
const esrFilePath = path.join(
61-
this.defaultDirectory ?? '',
62-
'main',
63-
'default',
64-
component.type.directoryName,
65-
`${esrFileName}-meta.xml`
66-
);
52+
const esrFilePath = path.join(this.defaultDirectory ?? '', component.type.directoryName, `${esrFileName}-meta.xml`);
6753
const xmlBuilder = new XMLBuilder({
6854
format: true,
6955
ignoreAttributes: false,

test/convert/transformers/decomposedExternalServiceRegistration.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('DecomposeExternalServiceRegistrationTransformer', () => {
2727
const result = await xf.toSourceFormat({ component });
2828
expect(result).to.have.length(2);
2929
result.map((l) => {
30-
expect(l.output).to.include(join('main', 'default', 'externalServiceRegistrations'));
30+
expect(l.output).to.include(join('externalServiceRegistrations'));
3131
});
3232
expect(result[0].output).to.match(/myESR\.yaml$/);
3333
expect(result[1].output).to.match(/myESR.externalServiceRegistration-meta\.xml$/);
@@ -51,7 +51,9 @@ describe('DecomposeExternalServiceRegistrationTransformer', () => {
5151
const xf = new DecomposeExternalServiceRegistrationTransformer(regAcc);
5252
const result = await xf.toMetadataFormat(component);
5353
expect(result).to.deep.equal([]);
54-
expect(xf.context.decomposedPermissionSet.permissionSetType).to.equal(regAcc.getTypeByName('PermissionSet'));
54+
expect(xf.context.decomposedExternalServiceRegistration.externalServiceRegistration).to.equal(
55+
regAcc.getTypeByName('externalServiceRegistration')
56+
);
5557
});
5658
});
5759
});

test/mock/type-constants/decomposeExternalServiceRegistrationConstants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ export const SOURCE_FORMAT_ESR = new SourceComponent(
102102
{
103103
name: 'myESR',
104104
type: externalServiceRegistration,
105-
xml: join('main', 'default', 'externalServiceRegistrations', SOURCE_XML_NAME),
105+
xml: join('externalServiceRegistrations', SOURCE_XML_NAME),
106106
},
107107
new VirtualTreeContainer([
108108
{
109-
dirPath: join('main', 'default', 'externalServiceRegistrations'),
109+
dirPath: join('externalServiceRegistrations'),
110110
children: [
111111
{
112112
name: 'myESR.externalServiceRegistrations-meta.xml',

0 commit comments

Comments
 (0)