mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
update tests to use :state()
This commit is contained in:
@@ -184,7 +184,7 @@ function runAllValidityTests(
|
||||
control.customError = 'MyError';
|
||||
await control.updateComplete;
|
||||
expect(control.validity.valid).to.equal(false);
|
||||
expect(control.hasAttribute('data-wa-invalid')).to.equal(true);
|
||||
expect(control.hasCustomState('invalid')).to.equal(true);
|
||||
expect(control.validationMessage).to.equal('MyError');
|
||||
});
|
||||
|
||||
@@ -193,7 +193,7 @@ function runAllValidityTests(
|
||||
// expect(control.validity.valid).to.equal(true)
|
||||
control.setAttribute('custom-error', 'MyError');
|
||||
await control.updateComplete;
|
||||
expect(control.hasAttribute('data-wa-invalid')).to.equal(true);
|
||||
expect(control.hasCustomState('invalid')).to.equal(true);
|
||||
expect(control.validationMessage).to.equal('MyError');
|
||||
});
|
||||
|
||||
@@ -207,7 +207,7 @@ function runAllValidityTests(
|
||||
expect(control.disabled).to.equal(true);
|
||||
// expect(control.hasAttribute("disabled")).to.equal(false)
|
||||
expect(control.matches(':disabled')).to.equal(true);
|
||||
expect(control.hasAttribute('data-wa-disabled')).to.equal(true);
|
||||
expect(control.hasCustomState('disabled')).to.equal(true);
|
||||
|
||||
fieldset.disabled = false;
|
||||
|
||||
@@ -215,7 +215,7 @@ function runAllValidityTests(
|
||||
expect(control.disabled).to.equal(false);
|
||||
expect(control.hasAttribute('disabled')).to.equal(false);
|
||||
expect(control.matches(':disabled')).to.equal(false);
|
||||
expect(control.hasAttribute('data-wa-disabled')).to.equal(false);
|
||||
expect(control.hasCustomState('disabled')).to.equal(false);
|
||||
});
|
||||
|
||||
// it("This is the one edge case with ':disabled'. If you disable a fieldset, and then disable the element directly, it will not reflect the disabled attribute.", async () => {
|
||||
@@ -246,7 +246,7 @@ function runAllValidityTests(
|
||||
expect(control.disabled).to.equal(true);
|
||||
expect(control.hasAttribute('disabled')).to.equal(true);
|
||||
expect(control.matches(':disabled')).to.equal(true);
|
||||
expect(control.hasAttribute('data-wa-disabled')).to.equal(true);
|
||||
expect(control.hasCustomState('disabled')).to.equal(true);
|
||||
|
||||
control.disabled = false;
|
||||
await control.updateComplete;
|
||||
@@ -254,7 +254,7 @@ function runAllValidityTests(
|
||||
expect(control.disabled).to.equal(false);
|
||||
expect(control.hasAttribute('disabled')).to.equal(false);
|
||||
expect(control.matches(':disabled')).to.equal(false);
|
||||
expect(control.hasAttribute('data-wa-disabled')).to.equal(false);
|
||||
expect(control.hasCustomState('disabled')).to.equal(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user