mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
[react-scroll-into-view-if-needed] Write better failing options test
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user