Skip to content

Commit 18d9fd9

Browse files
committed
test(playwright): extend profile field fixture support
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent a96674a commit 18d9fd9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

playwright/support/profile-fields.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33

44
import type { APIRequestContext } from '@playwright/test'
55

6-
type FieldType = 'text' | 'number'
6+
type FieldType = 'text' | 'number' | 'select'
77
type FieldVisibility = 'private' | 'users' | 'public'
88

99
type FieldDefinition = {
1010
id: number
1111
field_key: string
1212
label: string
1313
type: FieldType
14+
options: string[] | null
1415
admin_only: boolean
1516
user_editable: boolean
1617
user_visible: boolean
@@ -36,6 +37,7 @@ type DefinitionPayload = {
3637
fieldKey: string
3738
label: string
3839
type?: FieldType
40+
options?: string[]
3941
adminOnly?: boolean
4042
userEditable?: boolean
4143
userVisible?: boolean
@@ -102,6 +104,7 @@ export async function createDefinition(
102104
fieldKey: payload.fieldKey,
103105
label: payload.label,
104106
type: payload.type ?? 'text',
107+
...(payload.type === 'select' ? { options: payload.options ?? [] } : {}),
105108
adminOnly: payload.adminOnly ?? false,
106109
userEditable: payload.userEditable ?? true,
107110
userVisible: payload.userVisible ?? true,

0 commit comments

Comments
 (0)