Skip to content

Commit

Permalink
fix(abap-deploy-config): fix for local pkg verification (#2289)
Browse files Browse the repository at this point in the history
* fix(abap-deploy-config): fix for local pkg verification

* fix(abap-deploy-config): changeset
  • Loading branch information
cianmSAP authored Aug 27, 2024
1 parent 1da68be commit fc58821
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-weeks-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sap-ux/abap-deploy-config-inquirer': patch
---

fix for local package verification
2 changes: 1 addition & 1 deletion packages/abap-deploy-config-inquirer/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const ABAP_PACKAGE_SEARCH_MAX_RESULTS = 50;
export const DEFAULT_PACKAGE_ABAP = '$tmp';
export const DEFAULT_PACKAGE_ABAP = '$TMP';
export const CREATE_TR_DURING_DEPLOY = 'REPLACE_WITH_TRANSPORT';
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export async function validatePackage(
};

// checks if package is a local package and will update prompt state accordingly
await getTransportListFromService(input, answers.ui5AbapRepo ?? '', systemConfig, backendTarget);
await getTransportListFromService(input.toUpperCase(), answers.ui5AbapRepo ?? '', systemConfig, backendTarget);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('defaults', () => {
} as unknown as TransportConfig;

defaultPkg = defaultPackage();
expect(defaultPkg).toBe('$tmp');
expect(defaultPkg).toBe('$TMP');
});

it('should return default transport request choice', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ import {
} from '../../src/types';
import * as utils from '../../src/utils';
import { mockDestinations } from '../fixtures/destinations';
import * as serviceProviderUtils from '../../src/service-provider-utils';

jest.mock('../../src/service-provider-utils', () => ({
getTransportListFromService: jest.fn()
}));

describe('Test validators', () => {
beforeAll(async () => {
Expand Down Expand Up @@ -276,8 +281,13 @@ describe('Test validators', () => {

describe('validatePackage', () => {
it('should return error for invalid package input', async () => {
const result = await validatePackage('ZPACKAGE', {});
const getTransportListFromServiceSpy = jest.spyOn(serviceProviderUtils, 'getTransportListFromService');

const result = await validatePackage('zpackage', {
ui5AbapRepo: 'ZUI5REPO'
});
expect(result).toBe(true);
expect(getTransportListFromServiceSpy).toBeCalledWith('ZPACKAGE', 'ZUI5REPO', {}, undefined);
});
it('should return error for invalid package input', async () => {
const result = await validatePackage(' ', {});
Expand Down

0 comments on commit fc58821

Please sign in to comment.