-
Notifications
You must be signed in to change notification settings - Fork 19
/
init-form-values.spec.ts
32 lines (30 loc) · 1.12 KB
/
init-form-values.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { ApplicationAdvancedSettings } from 'qovery-typescript-axios'
import { applicationFactoryMock } from '@qovery/domains/application'
import { getServiceType } from '@qovery/shared/enums'
import { ApplicationEntity } from '@qovery/shared/interfaces'
import { initFormValues } from './init-form-values'
const mockApplication: ApplicationEntity = applicationFactoryMock(1)[0]
const mockAdvancedSettings: Partial<ApplicationAdvancedSettings> = {
'build.timeout_max_sec': 60,
'deployment.custom_domain_check_enabled': true,
'liveness_probe.http_get.path': '/',
}
mockApplication.advanced_settings = {
loadingStatus: 'loaded',
current_settings: mockAdvancedSettings,
}
describe('InitFormValues', () => {
it('should return the init values', () => {
expect(
initFormValues(
['build.timeout_max_sec', 'deployment.custom_domain_check_enabled', 'liveness_probe.http_get.path'],
mockApplication,
getServiceType(mockApplication)
)
).toStrictEqual({
'build.timeout_max_sec': '60',
'deployment.custom_domain_check_enabled': 'true',
'liveness_probe.http_get.path': '/',
})
})
})