Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should return item if $options.$extends.name matches given name', () => {
expect(querySelector(items, '2')).toEqual(items[2]);
});
it('should return undefined if no items in array', () => {
expect(querySelector([])).toEqual(undefined)
});
it('should return item if $children[0] matches given name', () => {
expect(querySelector(items, '6')).toEqual(items[6].$children[0]);
});
it('should return undefined if item below given search depth', () => {
expect(querySelector(items, '8', 2)).toEqual(undefined);
});
it('should return item if children[0] matches given name', () => {
expect(querySelector(items, '5')).toEqual(items[5].children[0]);
});
it('should return item if item above given search depth', () => {
expect(querySelector(items, '8', 3)).toEqual({ $options: { name: '8' } });
});
});
it('should return item if $options.name matches given name', () => {
expect(querySelector(items, '1')).toEqual(items[1]);
});
it('should return item if componentInstance.$options.$extends.name matches given name', () => {
expect(querySelector(items, '4')).toEqual(items[4]);
});
it('should return item if componentInstance.$options.name matches given name', () => {
expect(querySelector(items, '3')).toEqual(items[3]);
});
it('should return item if componentInstance.$children[0] matches given name', () => {
expect(querySelector(items, '7')).toEqual(items[7].componentInstance.$children[0]);
});