Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/utils/recaptcha.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function check_recaptcha_params(event) {
const { name, email, launch } = JSON.parse(event.body)
function check_recaptcha_params(name, email, launch) {
console.log("check_recaptcha_params", { name, email, launch })
if (name !== "") {
return {
Expand Down
1 change: 0 additions & 1 deletion tests/integration/microservices/back/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
# pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in
#

opengeodeweb-back==6.*,>=6.1.0rc3
1 change: 0 additions & 1 deletion tests/integration/microservices/viewer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in
#

opengeodeweb-viewer==1.*,>=1.15.1rc1
36 changes: 4 additions & 32 deletions tests/unit/utils/recaptcha.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,26 @@ describe("recaptcha", () => {
describe("wrong params", () => {
test("name", () => {
const name = "test"
const event = {
body: JSON.stringify({
name,
email,
launch,
}),
}
const result = check_recaptcha_params(event)
const result = check_recaptcha_params(name, email, launch)
expect(result.statusCode).toBe(internal_error)
})

test("email", () => {
const email = "test"
const event = {
body: JSON.stringify({
name,
email,
launch,
}),
}
const result = check_recaptcha_params(event)
const result = check_recaptcha_params(name, email, launch)
expect(result.statusCode).toBe(internal_error)
})

test("launch", () => {
const launch = true
const event = {
body: JSON.stringify({
name,
email,
launch,
}),
}
const result = check_recaptcha_params(event)
const result = check_recaptcha_params(name, email, launch)
expect(result.statusCode).toBe(internal_error)
})
})

describe("right params", () => {
test("name", () => {
const event = {
body: JSON.stringify({
name,
email,
launch,
}),
}
const result = check_recaptcha_params(event)
const result = check_recaptcha_params(name, email, launch)
expect(result.statusCode).toBe(success)
})
})
Expand Down
Loading