[react-scroll-into-view-if-needed] Write better failing options test

This commit is contained in:
Jonathan Ly
2019-02-25 13:45:35 +11:00
parent a4300b74f2
commit 5dcfc57e4f
@@ -1,6 +1,16 @@
import * as React from 'react';
import ReactScrollIntoViewIfNeeded from 'react-scroll-into-view-if-needed';
const validOptions = {
block: 'start',
scrollMode: 'if-needed',
skipOverflowHiddenElements: true
};
const invalidOptions = {
invalidOption: 'foobar'
};
() => (
<ReactScrollIntoViewIfNeeded
active={true}
@@ -17,7 +27,9 @@ import ReactScrollIntoViewIfNeeded from 'react-scroll-into-view-if-needed';
() => (
<ReactScrollIntoViewIfNeeded
options={invalidOptions} // $ExpectError
options={{
invalidOption: 'foobar' // $ExpectError
}}
>
Children
</ReactScrollIntoViewIfNeeded>