From a07c16fb52283217750e760fbc99aa70e538841e Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Tue, 6 Oct 2020 09:21:58 +0100 Subject: [PATCH] chore(start-compute-job): add test --- sasjs-tests/src/App.tsx | 4 +++- sasjs-tests/src/testSuites/Compute.ts | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 sasjs-tests/src/testSuites/Compute.ts diff --git a/sasjs-tests/src/App.tsx b/sasjs-tests/src/App.tsx index 746d12a..223f952 100644 --- a/sasjs-tests/src/App.tsx +++ b/sasjs-tests/src/App.tsx @@ -5,6 +5,7 @@ import { sendArrTests, sendObjTests } from "./testSuites/RequestData"; import { specialCaseTests } from "./testSuites/SpecialCases"; import { sasjsRequestTests } from "./testSuites/SasjsRequests"; import "@sasjs/test-framework/dist/index.css"; +import { computeTests } from "./testSuites/Compute"; const App = (): ReactElement<{}> => { const { adapter, config } = useContext(AppContext); @@ -17,7 +18,8 @@ const App = (): ReactElement<{}> => { sendArrTests(adapter), sendObjTests(adapter), specialCaseTests(adapter), - sasjsRequestTests(adapter) + sasjsRequestTests(adapter), + computeTests(adapter) ]); } }, [adapter, config]); diff --git a/sasjs-tests/src/testSuites/Compute.ts b/sasjs-tests/src/testSuites/Compute.ts new file mode 100644 index 0000000..eae2728 --- /dev/null +++ b/sasjs-tests/src/testSuites/Compute.ts @@ -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 + ); + } + } + ] +});