2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-16 09:10:33 +03:00

feat: scope the no-options slot (#1083)

Resolves #1071, Resolves #1081

https://vue-select.org/guide/slots.html#improving-the-default-no-options-text
This commit is contained in:
Jeff Sagal
2020-03-05 08:35:38 -08:00
committed by GitHub
parent a905f42271
commit be44b29ce2
5 changed files with 125 additions and 32 deletions
+16
View File
@@ -56,4 +56,20 @@ describe('Scoped Slots', () => {
expect(Select.find({ref: 'dropdownMenu'}).text()).toEqual('onetwothree');
});
it('noOptions slot receives the current search text', async () => {
const noOptions = jest.fn();
const Select = mountDefault({}, {
scopedSlots: {'no-options': noOptions},
});
Select.vm.search = 'something not there';
Select.vm.open = true;
await Select.vm.$nextTick();
expect(noOptions).toHaveBeenCalledWith({
search: 'something not there',
searching: true,
})
});
});