Files
React95/test/utils.js
2020-01-26 13:53:22 +01:00

37 lines
700 B
JavaScript

import React from 'react';
import { ThemeProvider } from 'styled-components';
import { render } from '@testing-library/react';
import themes from '../src/components/common/themes';
export const theme = themes.default;
export const renderWithTheme = component =>
render(<ThemeProvider theme={theme}>{component}</ThemeProvider>);
export class Touch {
constructor(instance) {
this.instance = instance;
}
get identifier() {
return this.instance.identifier;
}
get pageX() {
return this.instance.pageX;
}
get pageY() {
return this.instance.pageY;
}
get clientX() {
return this.instance.clientX;
}
get clientY() {
return this.instance.clientY;
}
}