improve user interaction heuristics; closes #1175

This commit is contained in:
Cory LaViska
2023-02-07 15:29:26 -05:00
parent b281c5bbc1
commit 527bf79973
13 changed files with 89 additions and 32 deletions

View File

@@ -130,6 +130,8 @@ describe('<sl-input>', () => {
await el.updateComplete;
await sendKeys({ press: 'b' });
await el.updateComplete;
el.blur();
await el.updateComplete;
expect(el.checkValidity()).to.be.true;
expect(el.hasAttribute('data-user-invalid')).to.be.false;
@@ -151,6 +153,8 @@ describe('<sl-input>', () => {
await sendKeys({ press: 'a' });
await sendKeys({ press: 'Backspace' });
await el.updateComplete;
el.blur();
await el.updateComplete;
expect(el.hasAttribute('data-user-invalid')).to.be.true;
expect(el.hasAttribute('data-user-valid')).to.be.false;
@@ -230,6 +234,8 @@ describe('<sl-input>', () => {
input.focus();
await sendKeys({ type: 'test' });
await input.updateComplete;
input.blur();
await input.updateComplete;
expect(input.hasAttribute('data-user-invalid')).to.be.true;
expect(input.hasAttribute('data-user-valid')).to.be.false;