mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-05-24 10:18:53 +00:00
chore: make text input field of kubernetes filepath in preferences page editable (#8139)
chore: make text input field of kubernetes filepath in preferences page editable Signed-off-by: Sonia Sandler <ssandler@redhat.com>
This commit is contained in:
parent
12077341a3
commit
5a3f29c8b3
3 changed files with 20 additions and 1 deletions
|
|
@ -197,6 +197,7 @@ export class KubernetesClient {
|
|||
type: 'string',
|
||||
default: defaultKubeconfigPath,
|
||||
format: 'file',
|
||||
readonly: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -160,10 +160,28 @@ test('Expect a fileinput when record is type string and format file', async () =
|
|||
expect(readOnlyInput).toBeInTheDocument();
|
||||
expect(readOnlyInput instanceof HTMLInputElement).toBe(true);
|
||||
expect((readOnlyInput as HTMLInputElement).placeholder).toBe(record.placeholder);
|
||||
expect((readOnlyInput as HTMLInputElement).readOnly).toBeTruthy();
|
||||
const input = screen.getByLabelText('browse');
|
||||
expect(input).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('Expect an editable text fileinput when record is type string and format file', async () => {
|
||||
const record: IConfigurationPropertyRecordedSchema = {
|
||||
title: 'record',
|
||||
parentId: 'parent.record',
|
||||
placeholder: 'Example: text',
|
||||
description: 'record-description',
|
||||
type: 'string',
|
||||
format: 'file',
|
||||
readonly: false,
|
||||
};
|
||||
await awaitRender(record, {});
|
||||
const writeInput = screen.getByLabelText('record-description');
|
||||
expect(writeInput).toBeInTheDocument();
|
||||
expect(writeInput instanceof HTMLInputElement).toBe(true);
|
||||
expect((writeInput as HTMLInputElement).readOnly).toBeFalsy();
|
||||
});
|
||||
|
||||
test('Expect a fileinput when record is type string and format folder', async () => {
|
||||
const record: IConfigurationPropertyRecordedSchema = {
|
||||
title: 'record',
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ $: if (value !== lastValue) {
|
|||
id="input-standard-{record.id}"
|
||||
name={record.id}
|
||||
bind:value={value}
|
||||
readonly
|
||||
readonly={record.readonly ?? true}
|
||||
placeholder={record.placeholder}
|
||||
options={dialogOptions}
|
||||
aria-invalid={invalidEntry}
|
||||
|
|
|
|||
Loading…
Reference in a new issue