From a2c57d4779bfb224608dba70e0ba009135e870f3 Mon Sep 17 00:00:00 2001 From: Christopher Lepski Date: Thu, 15 Aug 2024 14:05:38 +0200 Subject: [PATCH 1/2] fix: Make all fields except desc readonly --- packages/plugins/src/wizards/ln.ts | 4 ++++ packages/plugins/src/wizards/ln0.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/packages/plugins/src/wizards/ln.ts b/packages/plugins/src/wizards/ln.ts index 21924c2baa..0bf172882b 100644 --- a/packages/plugins/src/wizards/ln.ts +++ b/packages/plugins/src/wizards/ln.ts @@ -25,6 +25,7 @@ export function renderLNWizard( html``, @@ -37,11 +38,13 @@ export function renderLNWizard( html``, html``, ]; diff --git a/packages/plugins/src/wizards/ln0.ts b/packages/plugins/src/wizards/ln0.ts index d3ca8a45d7..ad06a7e1a6 100644 --- a/packages/plugins/src/wizards/ln0.ts +++ b/packages/plugins/src/wizards/ln0.ts @@ -24,6 +24,7 @@ export function renderLN0Wizard( html``, @@ -35,6 +36,7 @@ export function renderLN0Wizard( >`, html``, ]; From 9c4677768bd0f14de8ee829dd21c693a24c75758 Mon Sep 17 00:00:00 2001 From: Christopher Lepski Date: Thu, 15 Aug 2024 14:14:03 +0200 Subject: [PATCH 2/2] fix: Adjust tests --- packages/plugins/test/unit/wizards/ln.test.ts | 12 ++++++------ packages/plugins/test/unit/wizards/ln0.test.ts | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/plugins/test/unit/wizards/ln.test.ts b/packages/plugins/test/unit/wizards/ln.test.ts index a752fec87e..784c7bec10 100644 --- a/packages/plugins/test/unit/wizards/ln.test.ts +++ b/packages/plugins/test/unit/wizards/ln.test.ts @@ -21,9 +21,11 @@ describe('ln wizards', () => { lnClass: 'LN-class', inst: '1', }; - const requiredFields = [ + const readonlyFields = [ 'lnType', + 'prefix', 'lnClass', + 'inst' ]; const ln = ( @@ -56,15 +58,13 @@ describe('ln wizards', () => { }); }); - requiredFields.forEach((field) => { - it(`is a required field ${field}`, async () => { + readonlyFields.forEach((field) => { + it(`is a readonly field ${field}`, async () => { const input = (inputs).find( (textField) => textField.label === field ) as WizardTextField; - await setWizardTextFieldValue(input!, ''); - - expect(input.checkValidity()).to.be.false; + expect(input.readOnly).to.be.true; }); }); }); diff --git a/packages/plugins/test/unit/wizards/ln0.test.ts b/packages/plugins/test/unit/wizards/ln0.test.ts index c3fb5c2daf..b5e605059c 100644 --- a/packages/plugins/test/unit/wizards/ln0.test.ts +++ b/packages/plugins/test/unit/wizards/ln0.test.ts @@ -20,9 +20,10 @@ describe('ln0 wizards', () => { lnClass: 'LN0-class', inst: '1', }; - const requiredFields = [ + const readonlyFields = [ 'lnType', 'lnClass', + 'inst' ]; const ln = ( @@ -55,15 +56,13 @@ describe('ln0 wizards', () => { }); }); - requiredFields.forEach((field) => { - it(`is a required field ${field}`, async () => { + readonlyFields.forEach((field) => { + it(`is a readonly field ${field}`, async () => { const input = (inputs).find( (textField) => textField.label === field ) as WizardTextField; - await setWizardTextFieldValue(input!, ''); - - expect(input.checkValidity()).to.be.false; + expect(input.readOnly).to.be.true; }); }); });