Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as React from 'react';
import {configure, mount} from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';
import {RemoveScroll} from '../src/UI';
import {sidecar} from "use-sidecar";
configure({adapter: new Adapter()});
const tick = () => new Promise(resolve => setTimeout(resolve, 10));
const car = sidecar(() => import ('../src/sidecar'));
describe('UI', () => {
it('smoke', async () => {
const wrapper = mount(
content
);
await tick();
expect(wrapper.html()).toContain('content');
});
it('forward', async () => {
const wrapper = mount(
<div>content</div>
);
import { createMedium, createSidecarMedium } from 'use-sidecar';
export const mediumFocus = createMedium(
{},
({ target, currentTarget }) => ({ target, currentTarget }),
);
export const mediumBlur = createMedium();
export const mediumEffect = createMedium();
export const mediumSidecar = createSidecarMedium({
async: true,
});
import { createMedium, createSidecarMedium } from 'use-sidecar';
export const mediumFocus = createMedium(
{},
({ target, currentTarget }) => ({ target, currentTarget }),
);
export const mediumBlur = createMedium();
export const mediumEffect = createMedium();
export const mediumSidecar = createSidecarMedium({
async: true,
});
import { createMedium, createSidecarMedium } from 'use-sidecar';
export const mediumFocus = createMedium(
{},
({ target, currentTarget }) => ({ target, currentTarget }),
);
export const mediumBlur = createMedium();
export const mediumEffect = createMedium();
export const mediumSidecar = createSidecarMedium({
async: true,
});
import { createSidecarMedium } from 'use-sidecar';
export const effectCar = createSidecarMedium();
import { createSidecarMedium } from 'use-sidecar';
export const effectCar = createSidecarMedium();
export const focusHiddenMarker = 'data-focus-on-hidden';
import { createMedium, createSidecarMedium } from 'use-sidecar';
export const mediumFocus = createMedium(
{},
({ target, currentTarget }) => ({ target, currentTarget }),
);
export const mediumBlur = createMedium();
export const mediumEffect = createMedium();
export const mediumSidecar = createSidecarMedium({
async: true,
});
import { exportSidecar } from 'use-sidecar';
import { RemoveScrollSideCar } from './SideEffect';
import { effectCar } from './medium';
export default exportSidecar(effectCar, RemoveScrollSideCar);
import { exportSidecar } from 'use-sidecar';
import FocusTrap from './Trap';
import { mediumSidecar } from './medium';
export default exportSidecar(mediumSidecar, FocusTrap);
import { exportSidecar } from 'use-sidecar';
import 'react-focus-lock/sidecar';
import 'react-remove-scroll/sidecar';
import { Effect } from './Effect';
import { effectCar } from './medium';
export default exportSidecar(effectCar, Effect);