mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-29 20:12:33 +02:00
Click event tests on single select input
This commit is contained in:
parent
77a056f5a3
commit
b93362cbb0
|
@ -242,6 +242,35 @@ describe('Choices', function() {
|
|||
expect(this.choices.config.callbackOnChange).toHaveBeenCalledWith(jasmine.any(String), jasmine.any(HTMLElement));
|
||||
});
|
||||
|
||||
it('should open the dropdown on click', function() {
|
||||
const container = this.choices.containerOuter;
|
||||
this.choices._onClick({
|
||||
target: container,
|
||||
ctrlKey: false,
|
||||
preventDefault: () => {}
|
||||
});
|
||||
|
||||
expect(document.activeElement === this.choices.input && container.classList.contains('is-open')).toBe(true);
|
||||
});
|
||||
|
||||
it('should open the dropdown on click', function() {
|
||||
const container = this.choices.containerOuter;
|
||||
|
||||
this.choices._onClick({
|
||||
target: container,
|
||||
ctrlKey: false,
|
||||
preventDefault: () => {}
|
||||
});
|
||||
|
||||
this.choices._onClick({
|
||||
target: container,
|
||||
ctrlKey: false,
|
||||
preventDefault: () => {}
|
||||
});
|
||||
|
||||
expect(document.activeElement === this.choices.input && container.classList.contains('is-open')).toBe(false);
|
||||
});
|
||||
|
||||
it('should filter choices when searching', function() {
|
||||
this.choices.input.focus();
|
||||
this.choices.input.value = 'Value 3';
|
||||
|
|
Loading…
Reference in a new issue