diff --git a/sasjs-tests/src/App.tsx b/sasjs-tests/src/App.tsx index 066c12a..c2beeae 100644 --- a/sasjs-tests/src/App.tsx +++ b/sasjs-tests/src/App.tsx @@ -11,12 +11,13 @@ import { fileUploadTests } from './testSuites/FileUpload' const App = (): ReactElement<{}> => { const { adapter, config } = useContext(AppContext) const [testSuites, setTestSuites] = useState([]) + const appLoc = config.sasJsConfig.appLoc useEffect(() => { if (adapter) { const testSuites = [ basicTests(adapter, config.userName, config.password), - sendArrTests(adapter), + sendArrTests(adapter, appLoc), sendObjTests(adapter), specialCaseTests(adapter), sasjsRequestTests(adapter), @@ -24,7 +25,7 @@ const App = (): ReactElement<{}> => { ] if (adapter.getSasjsConfig().serverType === 'SASVIYA') { - testSuites.push(computeTests(adapter)) + testSuites.push(computeTests(adapter, appLoc)) } setTestSuites(testSuites) diff --git a/sasjs-tests/src/testSuites/Compute.ts b/sasjs-tests/src/testSuites/Compute.ts index 9aee0d6..a3c7024 100644 --- a/sasjs-tests/src/testSuites/Compute.ts +++ b/sasjs-tests/src/testSuites/Compute.ts @@ -3,7 +3,7 @@ import { TestSuite } from '@sasjs/test-framework' const stringData: any = { table1: [{ col1: 'first col value' }] } -export const computeTests = (adapter: SASjs): TestSuite => ({ +export const computeTests = (adapter: SASjs, appLoc: string): TestSuite => ({ name: 'Compute', tests: [ { @@ -35,7 +35,7 @@ export const computeTests = (adapter: SASjs): TestSuite => ({ description: 'Should start a compute job and return the session', test: () => { const data: any = { table1: [{ col1: 'first col value' }] } - return adapter.startComputeJob('/Public/app/common/sendArr', data) + return adapter.startComputeJob(`${appLoc}/common/sendArr`, data) }, assertion: (res: any) => { const expectedProperties = ['id', 'applicationName', 'attributes'] diff --git a/sasjs-tests/src/testSuites/RequestData.ts b/sasjs-tests/src/testSuites/RequestData.ts index 31f79b4..0237836 100644 --- a/sasjs-tests/src/testSuites/RequestData.ts +++ b/sasjs-tests/src/testSuites/RequestData.ts @@ -45,14 +45,14 @@ const getLargeObjectData = () => { return data } -export const sendArrTests = (adapter: SASjs): TestSuite => ({ +export const sendArrTests = (adapter: SASjs, appLoc: string): TestSuite => ({ name: 'sendArr', tests: [ { title: 'Absolute paths', description: 'Should work with absolute paths to SAS jobs', test: () => { - return adapter.request('/Public/app/common/sendArr', stringData) + return adapter.request(`${appLoc}/common/sendArr`, stringData) }, assertion: (res: any) => { return res.table1[0][0] === stringData.table1[0].col1