Skip to content

Commit

Permalink
fix test to assert checkValidity() instead validate()
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Sep 21, 2023
1 parent 7b2ef0b commit fc7685a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/vaadin-combo-box-light.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
});

it('should validate the paper-input element on checkValidity', () => {
const spy = sinon.spy(comboBox.inputElement, 'validate');
const spy = sinon.spy(comboBox.inputElement, 'checkValidity');

comboBox.required = true;
comboBox.value = 'foo';
Expand Down Expand Up @@ -309,33 +309,33 @@

it('should clear the selection when clicking on the clear button', () => {
comboBox.open();

fire('click', clearButton);

expect(comboBox.value).to.eql('');
expect(comboBox.$.overlay._selectedItem).to.be.null;
expect(comboBox.selectedItem).to.be.null;
});

it('should not close the dropdown after clearing a selection', () => {
comboBox.open();

fire('click', clearButton);

expect(comboBox.opened).to.eql(true);
});

it('should not open the dropdown after clearing a selection', () => {
fire('click', clearButton);

expect(comboBox.opened).to.eql(false);
});

it('should cancel click event to avoid input blur', () => {
comboBox.open();

const event = fire('click', clearButton);

expect(event.defaultPrevented).to.eql(true);
});

Expand Down

0 comments on commit fc7685a

Please sign in to comment.