Skip to content

Commit

Permalink
fix: Adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clepski committed Aug 15, 2024
1 parent a2c57d4 commit 9c46777
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions packages/plugins/test/unit/wizards/ln.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ describe('ln wizards', () => {
lnClass: 'LN-class',
inst: '1',
};
const requiredFields = [
const readonlyFields = [
'lnType',
'prefix',
'lnClass',
'inst'
];

const ln = <Element>(
Expand Down Expand Up @@ -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 = (<WizardInputElement[]>inputs).find(
(textField) => textField.label === field
) as WizardTextField;

await setWizardTextFieldValue(input!, '');

expect(input.checkValidity()).to.be.false;
expect(input.readOnly).to.be.true;
});
});
});
11 changes: 5 additions & 6 deletions packages/plugins/test/unit/wizards/ln0.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ describe('ln0 wizards', () => {
lnClass: 'LN0-class',
inst: '1',
};
const requiredFields = [
const readonlyFields = [
'lnType',
'lnClass',
'inst'
];

const ln = <Element>(
Expand Down Expand Up @@ -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 = (<WizardInputElement[]>inputs).find(
(textField) => textField.label === field
) as WizardTextField;

await setWizardTextFieldValue(input!, '');

expect(input.checkValidity()).to.be.false;
expect(input.readOnly).to.be.true;
});
});
});

0 comments on commit 9c46777

Please sign in to comment.