diff --git a/lib/before-test.ts b/lib/before-test.ts index 60f179fb..c911c8f8 100644 --- a/lib/before-test.ts +++ b/lib/before-test.ts @@ -3,8 +3,8 @@ const { configure } = require('enzyme'); import * as Adapter from 'enzyme-adapter-react-16'; configure({ adapter: new Adapter() }); -const { i18n, state, wpInfo } = require('../fixtures.ts'); -const styles = require('../../src/vendor/citation-styles.json'); +const { i18n, state, wpInfo } = require('./fixtures.ts'); +const styles = require('../src/vendor/citation-styles.json'); window.ABT = { state, diff --git a/lib/types/ABT.d.ts b/lib/types/ABT.d.ts index 3eaa11c9..432e4fe3 100644 --- a/lib/types/ABT.d.ts +++ b/lib/types/ABT.d.ts @@ -97,12 +97,9 @@ declare namespace ABT { | 'translator' | 'recipient'; - interface Field { + interface Field extends React.HTMLAttributes { value: string; label: string; - required: boolean; - pattern: string; - placeholder: string; } interface FieldMap { diff --git a/package.json b/package.json index fe81661e..5ecb9242 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "mapCoverage": true, "moduleDirectories": ["node_modules", "./src/js"], "moduleFileExtensions": ["ts", "tsx", "js"], - "setupFiles": ["raf/polyfill", "./lib/scripts/before-test.ts"], + "setupFiles": ["raf/polyfill", "./lib/before-test.ts"], "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", "transform": { ".(ts|tsx)": "/node_modules/ts-jest/preprocessor.js" diff --git a/src/js/dialogs/add/meta-fields.tsx b/src/js/dialogs/add/meta-fields.tsx index c31fc03c..0fedc164 100644 --- a/src/js/dialogs/add/meta-fields.tsx +++ b/src/js/dialogs/add/meta-fields.tsx @@ -61,17 +61,16 @@ interface FieldProps { class Field extends React.Component { render(): JSX.Element { const { onChange, field, meta } = this.props; + const { label, value, ...attrs } = field; return (
-