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 { h } from 'preact';
import * as React from "react";
import FocusLockUI from "react-focus-lock/UI";
import {sidecar} from "use-sidecar";
const styles = {
fontFamily: "sans-serif",
fontSize: "16px"
};
const bg = {
backgroundColor: '#FEE'
};
const FocusLockSidecar = sidecar(() => import("react-focus-lock/sidecar"));
class Trap extends React.Component {
state = {
disabled: true
}
toggle = () => this.setState({disabled: !this.state.disabled});
render() {
const {disabled} = this.state;
return (
{disabled && <div></div>
import React, {Component} from "react";
import {sidecar} from "use-sidecar";
import {FocusLockUI} from "../src/index";
const styles = {
fontFamily: "sans-serif",
textAlign: "center",
fontSize: "16px"
};
const bg = {
backgroundColor: '#FEE'
};
const FocusLockSidecar = sidecar(() => import("../src/sidecar"));
class Trap extends Component {
state = {
disabled: true
}
toggle = () => this.setState({disabled: !this.state.disabled});
render() {
const {disabled} = this.state;
return (
{disabled && <div></div>