mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-18 01:20:05 +00:00
chore(start-compute-job): add test
This commit is contained in:
@@ -5,6 +5,7 @@ import { sendArrTests, sendObjTests } from "./testSuites/RequestData";
|
|||||||
import { specialCaseTests } from "./testSuites/SpecialCases";
|
import { specialCaseTests } from "./testSuites/SpecialCases";
|
||||||
import { sasjsRequestTests } from "./testSuites/SasjsRequests";
|
import { sasjsRequestTests } from "./testSuites/SasjsRequests";
|
||||||
import "@sasjs/test-framework/dist/index.css";
|
import "@sasjs/test-framework/dist/index.css";
|
||||||
|
import { computeTests } from "./testSuites/Compute";
|
||||||
|
|
||||||
const App = (): ReactElement<{}> => {
|
const App = (): ReactElement<{}> => {
|
||||||
const { adapter, config } = useContext(AppContext);
|
const { adapter, config } = useContext(AppContext);
|
||||||
@@ -17,7 +18,8 @@ const App = (): ReactElement<{}> => {
|
|||||||
sendArrTests(adapter),
|
sendArrTests(adapter),
|
||||||
sendObjTests(adapter),
|
sendObjTests(adapter),
|
||||||
specialCaseTests(adapter),
|
specialCaseTests(adapter),
|
||||||
sasjsRequestTests(adapter)
|
sasjsRequestTests(adapter),
|
||||||
|
computeTests(adapter)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, [adapter, config]);
|
}, [adapter, config]);
|
||||||
|
|||||||
24
sasjs-tests/src/testSuites/Compute.ts
Normal file
24
sasjs-tests/src/testSuites/Compute.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import SASjs from "@sasjs/adapter";
|
||||||
|
import { TestSuite } from "@sasjs/test-framework";
|
||||||
|
|
||||||
|
export const computeTests = (adapter: SASjs): TestSuite => ({
|
||||||
|
name: "Compute",
|
||||||
|
tests: [
|
||||||
|
{
|
||||||
|
title: "Start Compute Job",
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
assertion: (res: any) => {
|
||||||
|
return (
|
||||||
|
!!res &&
|
||||||
|
!!res.applicationName &&
|
||||||
|
!!res.attributes &&
|
||||||
|
!!res.attributes.sessionInactiveTimeout
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user