Add data-testid attributes for improved testing in modals

This commit is contained in:
2025-05-31 20:23:15 +02:00
parent e279cd4535
commit e642b73556
7 changed files with 70 additions and 11 deletions

View File

@@ -63,6 +63,7 @@ const CreateWorkspaceModal: React.FC<CreateWorkspaceModalProps> = ({
<TextInput
label="Workspace Name"
placeholder="Enter workspace name"
data-testid="workspace-name-input"
value={name}
onChange={(event) => setName(event.currentTarget.value)}
mb="md"
@@ -74,10 +75,15 @@ const CreateWorkspaceModal: React.FC<CreateWorkspaceModalProps> = ({
variant="default"
onClick={() => setCreateWorkspaceModalVisible(false)}
disabled={loading}
data-testid="cancel-create-workspace-button"
>
Cancel
</Button>
<Button onClick={() => void handleSubmit} loading={loading}>
<Button
onClick={() => void handleSubmit}
loading={loading}
data-testid="confirm-create-workspace-button"
>
Create
</Button>
</Group>