Merge branch 'master' into execute-script-v2
This commit is contained in:
commit
ea73c8edb1
|
@ -90,7 +90,7 @@
|
||||||
$: requestEval(runtimeExpression, context, snippets)
|
$: requestEval(runtimeExpression, context, snippets)
|
||||||
$: bindingHelpers = new BindingHelpers(getCaretPosition, insertAtPos)
|
$: bindingHelpers = new BindingHelpers(getCaretPosition, insertAtPos)
|
||||||
|
|
||||||
$: bindingOptions = bindingsToCompletions(bindings, editorMode)
|
$: bindingOptions = bindingsToCompletions(enrichedBindings, editorMode)
|
||||||
$: helperOptions = allowHelpers ? getHelperCompletions(editorMode) : []
|
$: helperOptions = allowHelpers ? getHelperCompletions(editorMode) : []
|
||||||
$: snippetsOptions =
|
$: snippetsOptions =
|
||||||
usingJS && useSnippets && snippets?.length ? snippets : []
|
usingJS && useSnippets && snippets?.length ? snippets : []
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
// Directly mock the AWS SDK
|
|
||||||
jest.mock("@aws-sdk/s3-request-presigner", () => ({
|
|
||||||
getSignedUrl: jest.fn(() => {
|
|
||||||
return `http://example.com`
|
|
||||||
}),
|
|
||||||
}))
|
|
||||||
jest.mock("@aws-sdk/client-s3")
|
|
||||||
|
|
||||||
import { Datasource, SourceName } from "@budibase/types"
|
import { Datasource, SourceName } from "@budibase/types"
|
||||||
import { setEnv } from "../../../environment"
|
import { setEnv } from "../../../environment"
|
||||||
import { getRequest, getConfig, afterAll as _afterAll } from "./utilities"
|
import { getRequest, getConfig, afterAll as _afterAll } from "./utilities"
|
||||||
|
@ -92,7 +84,17 @@ describe("/static", () => {
|
||||||
.set(config.defaultHeaders())
|
.set(config.defaultHeaders())
|
||||||
.expect("Content-Type", /json/)
|
.expect("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
expect(res.body.signedUrl).toEqual("http://example.com")
|
|
||||||
|
expect(res.body.signedUrl).toStartWith(
|
||||||
|
"https://foo.s3.eu-west-1.amazonaws.com/bar?"
|
||||||
|
)
|
||||||
|
expect(res.body.signedUrl).toContain("X-Amz-Algorithm=AWS4-HMAC-SHA256")
|
||||||
|
expect(res.body.signedUrl).toContain("X-Amz-Credential=bb")
|
||||||
|
expect(res.body.signedUrl).toContain("X-Amz-Date=")
|
||||||
|
expect(res.body.signedUrl).toContain("X-Amz-Signature=")
|
||||||
|
expect(res.body.signedUrl).toContain("X-Amz-Expires=900")
|
||||||
|
expect(res.body.signedUrl).toContain("X-Amz-SignedHeaders=host")
|
||||||
|
|
||||||
expect(res.body.publicUrl).toEqual(
|
expect(res.body.publicUrl).toEqual(
|
||||||
`https://${bucket}.s3.eu-west-1.amazonaws.com/${key}`
|
`https://${bucket}.s3.eu-west-1.amazonaws.com/${key}`
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue