import { Ref, RefFindNode, RefForward } from '@fluentui/react-component-ref';
import { shallow } from 'enzyme';
import * as React from 'react';
import { CompositeClass, ForwardedRef } from './fixtures';
describe('Ref', () => {
describe('children', () => {
it('renders single child', () => {
const child =
;
const innerRef = React.createRef();
const component = shallow([{child}]);
expect(component.contains(child)).toBeTruthy();
});
it('renders RefFindNode when a component is passed', () => {
const innerRef = React.createRef();
const wrapper = shallow(
[
],
);
expect(wrapper.is(RefFindNode)).toBe(true);
});
it('renders RefForward when a component wrapper with forwardRef() is passed', () => {
const innerRef = React.createRef();
const wrapper = shallow(
[
],
);
expect(wrapper.is(RefForward)).toBe(true);
});
});
});