Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(abap-deploy-config): fix for local pkg verification #2289

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading