Skip to content

Commit

Permalink
fixed cicd tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scottheng96 committed Dec 17, 2024
1 parent 78a5871 commit 815573a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export const PublicFormSubmitButton = ({
const isMobile = useIsMobile()
const { isSubmitting } = useFormState()
const formInputs = useWatch<FormFieldValues>({}) as FormFieldValues
console.log(formFields)
console.log(formInputs)
const {
formId,
isPaymentEnabled,
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/features/public-form/utils/createSubmission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ export const createClearSubmissionWithVirusScanningFormData = (
...formDataArgsRest,
}),
)

console.log('here i am')
console.log(formData.get('body'))
if (!isEmpty(attachments)) {
forOwn(attachments, (attachment, fieldId) => {
if (attachment) {
Expand Down Expand Up @@ -249,9 +250,6 @@ const createResponsesArray = (
.map((ff) => transformInputsToOutputs(ff, formInputs[ff._id]))
.filter((output): output is FieldResponse => output !== null)

const v = validateResponses(transformedResponses)
console.log('testing')
console.log(v)
return validateResponses(transformedResponses)
}

Expand Down
13 changes: 0 additions & 13 deletions frontend/src/features/public-form/utils/inputTransformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,7 @@ const transformToAddressOutput = (
schema: AddressCompoundFieldSchema,
input?: AddressCompoundFieldValues | AddressCompoundFieldResponseV3,
): AddressResponse => {
// let answerArray: AddressAttributes
const answerArray: string[][] = []
// if (input !== undefined) {
// answerArray = input.addressSubFields
// } else {
// answerArray = {
// postalCode: '',
// blockNumber: '',
// streetName: '',
// buildingName: '',
// levelNumber: '',
// unitNumber: '',
// }
// }
if (input !== undefined) {
Object.entries(input.addressSubFields).map(([key, value]) =>
answerArray.push([`${key}: ${value}`]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ export const getAnswerForAddress = (
}
}


/**
* Formats the response for sending to the submitter (autoReplyData),
* the table that is sent to the admin (formData),
Expand Down
8 changes: 4 additions & 4 deletions src/app/utils/field-validation/validators/addressValidator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { chain, left, right } from 'fp-ts/lib/Either'
// import { chain, left, right } from 'fp-ts/lib/Either'
import { flow } from 'fp-ts/lib/function'

import { ProcessedAddressResponse } from 'src/app/modules/submission/submission.types'
Expand All @@ -8,8 +8,8 @@ import {
} from 'src/types'

import {
AddressCompoundFieldBase,
AddressResponse,
// AddressCompoundFieldBase,
// AddressResponse,
AddressResponseV3,
BasicField,
} from '../../../../../shared/types'
Expand All @@ -30,7 +30,7 @@ type AddressValidatorConstructor = (
*/
const addressValidator: AddressValidator = (response) => {
const { answerArray } = response
return validatePostalCode(answerArray.postalCode)
return validatePostalCode(answerArray[0][0]) // TODO
? right(response)
: left(`AddressValidator:\t answer is not a valid postal code`)
}
Expand Down

0 comments on commit 815573a

Please sign in to comment.