Fix static tests

This commit is contained in:
Leonid Logvinov 2019-01-09 10:54:32 +01:00
parent fd034cc1e4
commit 5868c91cfb
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4
3 changed files with 8 additions and 7 deletions

View File

@ -10,6 +10,7 @@ lib
/packages/metacoin/src/contract_wrappers /packages/metacoin/src/contract_wrappers
/packages/metacoin/artifacts /packages/metacoin/artifacts
/packages/sra-spec/public/ /packages/sra-spec/public/
/packages/dev-tools-pages/ts/**/data.json
package.json package.json
scripts/postpublish_utils.js scripts/postpublish_utils.js
packages/sol-cov/test/fixtures/artifacts packages/sol-cov/test/fixtures/artifacts

View File

@ -23,10 +23,10 @@ class BaseAnimation extends React.PureComponent<AnimationProps, AnimationState>
private _timeout = undefined as number; private _timeout = undefined as number;
public componentDidMount(): void { public componentDidMount(): void {
this._updateAnimationSize(); this._updateAnimationSize();
window.addEventListener('resize', this._handleResize); window.addEventListener('resize', this._handleResize.bind(this));
} }
public componentWillUnmount(): void { public componentWillUnmount(): void {
window.removeEventListener('resize', this._handleResize); window.removeEventListener('resize', this._handleResize.bind(this));
} }
public render(): React.ReactNode { public render(): React.ReactNode {
const { animationData } = this.props; const { animationData } = this.props;
@ -49,11 +49,11 @@ class BaseAnimation extends React.PureComponent<AnimationProps, AnimationState>
</Container> </Container>
); );
} }
private readonly _handleResize = () => { private _handleResize(): void {
clearTimeout(this._timeout); clearTimeout(this._timeout);
this._timeout = window.setTimeout(this._updateAnimationSize, 50); this._timeout = window.setTimeout(this._updateAnimationSize.bind(this), 50);
} }
private readonly _updateAnimationSize = () => { private _updateAnimationSize(): void {
const windowWidth = window.innerWidth; const windowWidth = window.innerWidth;
let width; let width;
let height; let height;

View File

@ -164,7 +164,7 @@ class Code extends React.Component<CodeProps, CodeState> {
) : null} ) : null}
</Base> </Base>
{navigator.userAgent !== 'ReactSnap' && canCopy ? ( {navigator.userAgent !== 'ReactSnap' && canCopy ? (
<Button onClick={this._handleCopyAsync}>{this.state.didCopy ? 'Copied' : 'Copy'}</Button> <Button onClick={this._handleCopyAsync.bind(this)}>{this.state.didCopy ? 'Copied' : 'Copy'}</Button>
) : null} ) : null}
</Container> </Container>
); );
@ -182,7 +182,7 @@ class Code extends React.Component<CodeProps, CodeState> {
}); });
} }
} }
private readonly _handleCopyAsync = async () => { private async _handleCopyAsync(): Promise<void> {
try { try {
if ('clipboard' in navigator) { if ('clipboard' in navigator) {
await (navigator as any).clipboard.writeText(this.props.children); await (navigator as any).clipboard.writeText(this.props.children);