import { mountDefault } from '../helpers';
describe('Scoped Slots', () => {
it('receives an option object to the selected-option-container slot', () => {
const Select = mountDefault(
{value: 'one'},
{
scopedSlots: {
'selected-option-container': `{{ option.label }}`,
},
});
expect(Select.find({ ref: 'selectedOptions' }).text()).toEqual('one')
});
it('receives an option object to the selected-option slot', () => {
const Select = mountDefault(
{value: 'one'},
{
scopedSlots: {
'selected-option': `{{ option.label }}`,
},
});
expect(Select.find('.vs__selected').text()).toEqual('one')
});
it('receives an option object to the option slot in the dropdown menu', () => {
const Select = mountDefault(
{value: 'one'},
{
scopedSlots: {
'option': `{{ option.label }}`,
},
});
Select.vm.open = true;
expect(Select.find({ref: 'dropdownMenu'}).text()).toEqual('onetwothree')
});
});