Skip to content
Open
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
5 changes: 2 additions & 3 deletions packages/backend/src/apps/formsg/__tests__/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import type { IGlobalVariable } from '@plumber/types'
import type { AxiosPromise } from 'axios'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'

import apps from '@/apps'
import globalVariable from '@/helpers/global-variable'
import type Connection from '@/models/connection'

import formSgApp from '../'

const mocks = vi.hoisted(() => ({
axiosRequestAdapter: vi.fn(
async (requestConfig): AxiosPromise => ({
Expand Down Expand Up @@ -53,7 +52,7 @@ describe('FormSG app', () => {
connection: {
formattedData: {},
} as unknown as Connection,
app: formSgApp,
app: apps.formsg,
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { IGlobalVariable, IRequest } from '@plumber/types'
import { Settings as LuxonSettings } from 'luxon'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'

import apps from '@/apps'
import { FOR_EACH_INPUT_SOURCE } from '@/apps/toolbox/common/constants'

import app from '../..'
import { decryptFormResponse } from '../../auth/decrypt-form-response'
import { NricFilter } from '../../triggers/new-submission'

Expand Down Expand Up @@ -92,7 +92,7 @@ describe('decrypt form response', () => {
},
step: {
id: '123',
appKey: app.key,
appKey: apps.formsg.key,
position: 0,
parameters: {
nricFilter: undefined,
Expand All @@ -110,7 +110,7 @@ describe('decrypt form response', () => {
createdAt: `${new Date().getTime()}`,
updatedAt: `${new Date().getTime()}`,
},
app,
app: apps.formsg,
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { IGlobalVariable, IHttpClient } from '@plumber/types'

import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'

import app from '../..'
import apps from '@/apps'

import {
parseFormIdFormat,
parseSecretKeyFormat,
Expand Down Expand Up @@ -49,7 +50,7 @@ describe('verify credentials', () => {
},
}),
} as unknown as IHttpClient, // deliberately cast
app,
app: apps.formsg,
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { IGlobalVariable, IHttpClient } from '@plumber/types'
import { AxiosError } from 'axios'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'

import apps from '@/apps'
import HttpError from '@/errors/http'

import app from '../..'
import {
FORMSG_WEBHOOK_REGISTRATION_MESSAGE,
FORMSG_WEBHOOK_VERIFICATION_MESSAGE,
Expand Down Expand Up @@ -37,7 +37,7 @@ describe('formsg webhook registration', () => {
createdAt: `${new Date().getTime()}`,
updatedAt: `${new Date().getTime()}`,
},
app,
app: apps.formsg,
}
})

Expand Down
Loading