mirror of
https://github.com/sasjs/adapter.git
synced 2026-06-10 18:50:22 +00:00
fix(webjob): test coverage for _executionTasks=true requests without file upload (#883)
* test(cypress): show individual errors * test(cypress): half the cypress integration test timeout * test(cypress): add parallel tests, timeout and reports * test(cypress): use allSettled instead of all * test(runner): pre-render pending test cards
This commit is contained in:
committed by
GitHub
parent
eb1186b4b9
commit
55db8f45ab
@@ -0,0 +1,61 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import SASjs from '@sasjs/adapter'
|
||||
import type { TestSuite } from '../types'
|
||||
|
||||
const tableData: any = { table1: [{ col1: 'first col value' }] }
|
||||
const fileData: any = { table1: [{ col1: 'value with ; semicolon' }] }
|
||||
|
||||
export const executionTasksTests = (adapter: SASjs): TestSuite => ({
|
||||
name: '_executionTasks=true behaviour',
|
||||
tests: [
|
||||
{
|
||||
title: 'sends table data in body',
|
||||
description: 'table payload, no _executionTasks flag',
|
||||
test: () =>
|
||||
adapter
|
||||
.request('services/common/sendArr', tableData, {
|
||||
useComputeApi: null
|
||||
})
|
||||
.then((res: any) => ({ ok: true, res }))
|
||||
.catch((e: any) => ({ ok: false, error: e })),
|
||||
assertion: (res: any) => res?.ok === true
|
||||
},
|
||||
{
|
||||
title: 'sends table data when _executionTasks=true',
|
||||
description: 'table payload with _executionTasks=true',
|
||||
test: () =>
|
||||
adapter
|
||||
.request('services/common/sendArr&_executionTasks=true', tableData, {
|
||||
useComputeApi: null
|
||||
})
|
||||
.then((res: any) => ({ ok: true, res }))
|
||||
.catch((e: any) => ({ ok: false, error: e })),
|
||||
assertion: (res: any) => res?.ok === true
|
||||
},
|
||||
{
|
||||
title: 'uploads as file when payload has semicolons',
|
||||
description: 'semicolon payload, no _executionTasks flag',
|
||||
test: () =>
|
||||
adapter
|
||||
.request('services/common/sendArr', fileData, {
|
||||
useComputeApi: null
|
||||
})
|
||||
.then((res: any) => ({ ok: true, res }))
|
||||
.catch((e: any) => ({ ok: false, error: e })),
|
||||
assertion: (res: any) => res?.ok === true
|
||||
},
|
||||
{
|
||||
title:
|
||||
'uploads as file when _executionTasks=true and payload has semicolons',
|
||||
description: 'semicolon payload with _executionTasks=true',
|
||||
test: () =>
|
||||
adapter
|
||||
.request('services/common/sendArr&_executionTasks=true', fileData, {
|
||||
useComputeApi: null
|
||||
})
|
||||
.then((res: any) => ({ ok: true, res }))
|
||||
.catch((e: any) => ({ ok: false, error: e })),
|
||||
assertion: (res: any) => res?.ok === true
|
||||
}
|
||||
]
|
||||
})
|
||||
Reference in New Issue
Block a user